diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 3dd34a3e6912..3260facf183e 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -50,6 +50,7 @@ Context::Context(const Lex::TokenizedBuffer& tokens, DiagnosticEmitter& emitter, vlog_stream_(vlog_stream), node_stack_(parse_tree, vlog_stream), inst_block_stack_("inst_block_stack_", sem_ir, vlog_stream), + pattern_block_stack_("pattern_block_stack_", sem_ir, vlog_stream), param_and_arg_refs_stack_(sem_ir, vlog_stream, node_stack_), args_type_info_stack_("args_type_info_stack_", sem_ir, vlog_stream), decl_name_stack_(this), @@ -82,6 +83,7 @@ auto Context::VerifyOnFinish() -> void { // node_stack_ will still contain top-level entities. scope_stack_.VerifyOnFinish(); inst_block_stack_.VerifyOnFinish(); + pattern_block_stack_.VerifyOnFinish(); param_and_arg_refs_stack_.VerifyOnFinish(); } @@ -177,6 +179,13 @@ auto Context::AddPlaceholderInst(SemIR::LocIdAndInst loc_id_and_inst) return inst_id; } +auto Context::AddPatternInst(SemIR::LocIdAndInst loc_id_and_inst) + -> SemIR::InstId { + auto inst_id = AddInstInNoBlock(loc_id_and_inst); + pattern_block_stack_.AddInstId(inst_id); + return inst_id; +} + auto Context::AddConstant(SemIR::Inst inst, bool is_symbolic) -> SemIR::ConstantId { auto const_id = constants().GetOrAdd(inst, is_symbolic); @@ -1285,6 +1294,7 @@ auto Context::PrintForStackDump(llvm::raw_ostream& output) const -> void { SemIR::Formatter formatter(*tokens_, *parse_tree_, *sem_ir_); node_stack_.PrintForStackDump(formatter, Indent, output); inst_block_stack_.PrintForStackDump(formatter, Indent, output); + pattern_block_stack_.PrintForStackDump(formatter, Indent, output); param_and_arg_refs_stack_.PrintForStackDump(formatter, Indent, output); args_type_info_stack_.PrintForStackDump(formatter, Indent, output); } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 5a7924846dca..960a0c84c39a 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -126,6 +126,18 @@ class Context { auto AddPlaceholderInstInNoBlock(SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId; + // Adds an instruction to the current pattern block, returning the produced + // ID. + auto AddPatternInst(SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId; + + // Convenience for AddPatternInst with typed nodes. + template + requires(SemIR::Internal::HasNodeId) + auto AddPatternInst(decltype(InstT::Kind)::TypedNodeId node_id, InstT inst) + -> SemIR::InstId { + return AddPatternInst(SemIR::LocIdAndInst(node_id, inst)); + } + // Adds an instruction to the constants block, returning the produced ID. auto AddConstant(SemIR::Inst inst, bool is_symbolic) -> SemIR::ConstantId; @@ -405,6 +417,7 @@ class Context { auto node_stack() -> NodeStack& { return node_stack_; } auto inst_block_stack() -> InstBlockStack& { return inst_block_stack_; } + auto pattern_block_stack() -> InstBlockStack& { return pattern_block_stack_; } auto param_and_arg_refs_stack() -> ParamAndArgRefsStack& { return param_and_arg_refs_stack_; @@ -547,6 +560,9 @@ class Context { // The stack of instruction blocks being used for general IR generation. InstBlockStack inst_block_stack_; + // The stack of instruction blocks that contain pattern instructions. + InstBlockStack pattern_block_stack_; + // The stack of instruction blocks being used for param and arg ref blocks. ParamAndArgRefsStack param_and_arg_refs_stack_; diff --git a/toolchain/check/decl_name_stack.h b/toolchain/check/decl_name_stack.h index 3d3bf83c4306..f0f8d8324521 100644 --- a/toolchain/check/decl_name_stack.h +++ b/toolchain/check/decl_name_stack.h @@ -100,6 +100,7 @@ class DeclNameStack { .generic_id = SemIR::GenericId::Invalid, .first_param_node_id = name.first_param_node_id, .last_param_node_id = name.last_param_node_id, + .pattern_block_id = name.pattern_block_id, .implicit_param_refs_id = name.implicit_params_id, .param_refs_id = name.params_id, .is_extern = is_extern, diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 5f0faefe1021..fe41795fac8a 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1438,6 +1438,7 @@ auto TryEvalInstInContext(EvalContext& eval_context, SemIR::InstId inst_id, case SemIR::AddrPattern::Kind: case SemIR::Assign::Kind: case SemIR::BindName::Kind: + case SemIR::BindingPattern::Kind: case SemIR::BlockArg::Kind: case SemIR::Branch::Kind: case SemIR::BranchIf::Kind: @@ -1448,6 +1449,7 @@ auto TryEvalInstInContext(EvalContext& eval_context, SemIR::InstId inst_id, 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/global_init.cpp b/toolchain/check/global_init.cpp index d31b51fe1c8b..d0f28df9352b 100644 --- a/toolchain/check/global_init.cpp +++ b/toolchain/check/global_init.cpp @@ -40,6 +40,7 @@ auto GlobalInit::Finalize() -> void { .generic_id = SemIR::GenericId::Invalid, .first_param_node_id = Parse::NodeId::Invalid, .last_param_node_id = Parse::NodeId::Invalid, + .pattern_block_id = SemIR::InstBlockId::Empty, .implicit_param_refs_id = SemIR::InstBlockId::Invalid, .param_refs_id = SemIR::InstBlockId::Empty, .is_extern = false, diff --git a/toolchain/check/handle_alias.cpp b/toolchain/check/handle_alias.cpp index f3233c77299c..dd3dd3999e02 100644 --- a/toolchain/check/handle_alias.cpp +++ b/toolchain/check/handle_alias.cpp @@ -16,6 +16,11 @@ auto HandleParseNode(Context& context, Parse::AliasIntroducerId /*node_id*/) -> bool { context.decl_introducer_state_stack().Push(); context.decl_name_stack().PushScopeAndStartName(); + + // Push a pattern block to handle parameters of the alias declaration. + // TODO: Disallow these in parse, instead of check, so we don't have to do + // this. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index c89dc81da4b0..121f9ecbb97f 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -167,6 +167,20 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_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; + if (is_generic) { + context.AddPatternInst( + name_node, + {.type_id = cast_type_id, .entity_name_id = entity_name_id}); + } else { + context.AddPatternInst( + name_node, + {.type_id = cast_type_id, .entity_name_id = entity_name_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. break; } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 664c04a313aa..ad947523a16b 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -41,6 +41,10 @@ auto HandleParseNode(Context& context, Parse::ClassIntroducerId node_id) context.decl_name_stack().PushScopeAndStartName(); // This class is potentially generic. StartGenericDecl(context); + // Push a pattern block for the signature (if any) of the first NameComponent. + // TODO: Instead use a separate parse node kind for an identifier that's + // followed by a pattern, and push a pattern block when handling it. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/handle_export.cpp b/toolchain/check/handle_export.cpp index 32b939b35495..0203e94df33d 100644 --- a/toolchain/check/handle_export.cpp +++ b/toolchain/check/handle_export.cpp @@ -18,6 +18,9 @@ auto HandleParseNode(Context& context, Parse::ExportIntroducerId /*node_id*/) context.decl_introducer_state_stack().Push(); // TODO: Probably need to update DeclNameStack to restrict to only namespaces. context.decl_name_stack().PushScopeAndStartName(); + // The parser supports patterns after `export`, so we need a pattern block + // to handle them. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index c06bd8c174d8..54bcbbce9ffc 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -35,6 +35,8 @@ auto HandleParseNode(Context& context, Parse::FunctionIntroducerId node_id) context.decl_name_stack().PushScopeAndStartName(); // The function is potentially generic. StartGenericDecl(context); + // Start a new pattern block for the signature. + context.pattern_block_stack().Push(); return true; } @@ -213,8 +215,6 @@ static auto BuildFunctionDecl(Context& context, Parse::AnyFunctionDeclId node_id, bool is_definition) -> std::pair { - auto decl_block_id = context.inst_block_stack().Pop(); - auto return_storage_id = SemIR::InstId::Invalid; if (auto [return_node, maybe_return_storage_id] = context.node_stack().PopWithNodeIdIf(); @@ -260,6 +260,7 @@ static auto BuildFunctionDecl(Context& context, } // Add the function declaration. + auto decl_block_id = context.inst_block_stack().Pop(); auto function_decl = SemIR::FunctionDecl{ SemIR::TypeId::Invalid, SemIR::FunctionId::Invalid, decl_block_id}; auto decl_id = diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 70f27ac0f992..adfbfd4f1230 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -30,6 +30,12 @@ auto HandleParseNode(Context& context, Parse::ImplIntroducerId node_id) // consistent to imagine that it does. This also gives us a scope for implicit // parameters. context.decl_name_stack().PushScopeAndStartName(); + + // Push a pattern block for the signature of the `forall` (if any). + // TODO: Instead use a separate parse node kinds for `impl` and `impl forall`, + // and only push a pattern block in `forall` case. + context.pattern_block_stack().Push(); + return true; } @@ -213,6 +219,8 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id, // TODO: Does lookup in an impl file need to look for a prior impl declaration // in the api file? auto impl_id = context.impls().LookupOrAdd(self_type_id, constraint_type_id); + context.impls().Get(impl_id).pattern_block_id = + context.pattern_block_stack().Pop(); SemIR::ImplDecl impl_decl = {.impl_id = impl_id, .decl_block_id = decl_block_id}; auto impl_decl_id = context.AddInst(node_id, impl_decl); diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index 21c8a68ddbdf..502b9a06613d 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -25,6 +25,10 @@ auto HandleParseNode(Context& context, Parse::InterfaceIntroducerId node_id) context.decl_name_stack().PushScopeAndStartName(); // This interface is potentially generic. StartGenericDecl(context); + // Push a pattern block for the signature (if any) of the first NameComponent. + // TODO: Instead use a separate parse node kind for an identifier that's + // followed by a pattern, and push a pattern block when handling it. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index 1662e4a7c010..4887bef9083e 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -19,8 +19,9 @@ namespace Carbon::Check { template static auto HandleIntroducer(Context& context, Parse::NodeId node_id) -> bool { context.decl_introducer_state_stack().Push(); - // Push a bracketing node to establish the pattern context. + // Push a bracketing node and pattern block to establish the pattern context. context.node_stack().Push(node_id); + context.pattern_block_stack().Push(); return true; } @@ -145,6 +146,11 @@ template std::optional { std::optional decl_info = DeclInfo(); + + // TODO: update binding-pattern handling to use the pattern block even in + // a let/var context, and then consume it here. + context.pattern_block_stack().PopAndDiscard(); + // Handle the optional initializer. if (context.node_stack().PeekNextIs()) { decl_info->init_id = context.node_stack().PopExpr(); diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index 2be40d3bb097..7c30092518fe 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -175,6 +175,10 @@ auto HandleParseNode(Context& context, Parse::SelfValueNameExprId node_id) auto HandleParseNode(Context& context, Parse::NameQualifierId /*node_id*/) -> bool { context.decl_name_stack().ApplyNameQualifier(PopNameComponent(context)); + // Push a pattern block for the signature (if any) of the next NameComponent. + // TODO: Instead use a separate parse node kind for an identifier that's + // followed by a pattern, and push a pattern block when handling it. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/handle_namespace.cpp b/toolchain/check/handle_namespace.cpp index de5478e2fb1d..8769c660ca94 100644 --- a/toolchain/check/handle_namespace.cpp +++ b/toolchain/check/handle_namespace.cpp @@ -18,6 +18,11 @@ auto HandleParseNode(Context& context, Parse::NamespaceStartId /*node_id*/) // Optional modifiers and the name follow. context.decl_introducer_state_stack().Push(); context.decl_name_stack().PushScopeAndStartName(); + + // Push a pattern block to handle parameters of the namespace declaration. + // TODO: Disallow these in parse, instead of check, so we don't have to do + // this. + context.pattern_block_stack().Push(); return true; } diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 952e75d1eab2..14c10f65d20e 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -868,6 +868,7 @@ class ImportRefResolver { .generic_id = MakeIncompleteGeneric(decl_id, import_base.generic_id), .first_param_node_id = Parse::NodeId::Invalid, .last_param_node_id = Parse::NodeId::Invalid, + .pattern_block_id = SemIR::InstBlockId::Invalid, .implicit_param_refs_id = import_base.implicit_param_refs_id.is_valid() ? SemIR::InstBlockId::Empty : SemIR::InstBlockId::Invalid, diff --git a/toolchain/check/name_component.cpp b/toolchain/check/name_component.cpp index d43d41d1154b..2e576a07082a 100644 --- a/toolchain/check/name_component.cpp +++ b/toolchain/check/name_component.cpp @@ -48,6 +48,7 @@ auto PopNameComponent(Context& context) -> NameComponent { implicit_params_id.value_or(SemIR::InstBlockId::Invalid), .params_loc_id = params_loc_id, .params_id = params_id.value_or(SemIR::InstBlockId::Invalid), + .pattern_block_id = context.pattern_block_stack().Pop(), }; } diff --git a/toolchain/check/name_component.h b/toolchain/check/name_component.h index e058e52eacf0..af2aaae39a2b 100644 --- a/toolchain/check/name_component.h +++ b/toolchain/check/name_component.h @@ -33,13 +33,16 @@ struct NameComponent { // The explicit parameter list. Parse::NodeId params_loc_id; SemIR::InstBlockId params_id; + + // The pattern block. + SemIR::InstBlockId pattern_block_id; }; -// Pop a name component from the node stack. +// Pop a name component from the node stack and pattern block stack. auto PopNameComponent(Context& context) -> NameComponent; -// Pop the name of a declaration from the node stack, and diagnose if it has -// parameters. +// Pop the name of a declaration from the node stack and pattern block stack, +// and diagnose if it has parameters. auto PopNameComponentWithoutParams(Context& context, Lex::TokenKind introducer) -> NameComponent; diff --git a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon index 695325091cab..d723fa4b98bf 100644 --- a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon +++ b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon @@ -33,7 +33,7 @@ let d: c = {}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = @__global_init.%d // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index f1f047cd98a0..702f144bab9d 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -81,7 +81,7 @@ var d: D* = &c; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index 73f2d897efe8..613bf9c29ef7 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -39,8 +39,8 @@ let c_var: c = d; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .c_var = @__global_init.%c_var // 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: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %c: type = bind_alias c, %C.decl [template = constants.%C] // CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] diff --git a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon index 9656040f434d..ab89323d530a 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon @@ -41,10 +41,10 @@ fn F() -> {} { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %NS: = namespace [template] {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc13_12.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_12.2: type = converted %.loc13_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index a7231950decd..07d20d5c192a 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -63,7 +63,7 @@ extern alias C = Class; // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %Class.ref.loc38: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %A: type = bind_alias A, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %Class.ref.loc44: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index 1a6fd6b9b065..071ccccdbb8a 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -46,7 +46,7 @@ alias b = C; // CHECK:STDOUT: .a = %a.loc13 // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc13: type = bind_alias a, %C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon index 8817318f323a..22aa1aecb416 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon @@ -31,7 +31,7 @@ fn F() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon index 1077c382900e..375f3b26facc 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon @@ -28,9 +28,9 @@ alias A(T:! type) = T*; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc18_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc18_9.2: type = bind_symbolic_name T 0, %T.loc18_9.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc18_9.2 [symbolic = constants.%T] +// 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: %A: = bind_alias A, [template = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index 3d0a1281de85..b075af6f0083 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -81,7 +81,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .c_alias = %c_alias // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %c_alias: type = bind_alias c_alias, %C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 3edfd8234e2e..1fc63d22f0f3 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -65,7 +65,7 @@ var inst: Test.A = {}; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .A [private] = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %A: type = bind_alias A, %C.decl [template = constants.%C] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index b198a10ff0b2..e35dacc3a446 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -48,7 +48,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] diff --git a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon index b41029212990..9f7224ce0682 100644 --- a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon @@ -41,18 +41,18 @@ fn F() -> NS.a { // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] -// CHECK:STDOUT: %NS.ref.loc16: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %a.ref.loc16: type = name_ref a, %a [template = constants.%C] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %NS.ref.loc18: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %a.ref.loc18: type = name_ref a, %a [template = constants.%C] -// CHECK:STDOUT: @F.%return: ref %C = var +// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] +// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] +// CHECK:STDOUT: %a.ref: type = name_ref a, file.%a [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/local.carbon b/toolchain/check/testdata/alias/no_prelude/local.carbon index dadb761339e7..a2877f62d57b 100644 --- a/toolchain/check/testdata/alias/no_prelude/local.carbon +++ b/toolchain/check/testdata/alias/no_prelude/local.carbon @@ -27,10 +27,10 @@ fn F() -> () { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc11_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index ae7eac09d470..4c07a92c5def 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -57,7 +57,7 @@ fn G() { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] @@ -69,9 +69,9 @@ fn G() { // CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] // CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index bf0197dec4ad..61226e902b9b 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -56,7 +56,7 @@ fn G() { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 631818cc770c..1cc2a8bd8fd5 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -55,15 +55,15 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32) // CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32] // CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 8325eb41325c..403f3a80f5fc 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 04f1b92f89c5..e0d17eda7c8f 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -50,25 +50,28 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = %a.loc13 +// CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -79,7 +82,7 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13, %.loc13_9.1 [template = i32] // CHECK:STDOUT: %.loc13_23: type = array_type %int.sadd, i32 [template = constants.%.5] // CHECK:STDOUT: %a.var: ref %.5 = var a -// CHECK:STDOUT: %a.loc13: ref %.5 = bind_name a, %a.var +// CHECK:STDOUT: %a: ref %.5 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] @@ -110,7 +113,7 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %.loc13_35.11: init %.5 = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array] // CHECK:STDOUT: %.loc13_36: init %.5 = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc13_36 -// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, file.%a.loc13 +// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, file.%a // CHECK:STDOUT: %.loc14: %.6 = addr_of %a.ref // CHECK:STDOUT: %b: %.6 = bind_name b, %.loc14 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index f09108c91ed8..bf4ea9516bbf 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -50,22 +50,24 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: } // 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: } { // 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.loc11_11.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Negate.%n: i32 = bind_name n, %n.loc11_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] +// 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] // CHECK:STDOUT: %.loc16_21: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21) [template = constants.%.3] -// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32.loc16, %.loc16_9.1 [template = i32] +// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32, %.loc16_9.1 [template = i32] // CHECK:STDOUT: %.loc16_23: type = array_type %int.snegate, i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index 211a8b99262f..68ad2aca7d18 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -68,12 +68,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index c6b4213bb3e6..bb2821ecbe3d 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -51,7 +51,7 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc19_21: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, %Incomplete [template = constants.%.2] diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 68aa24f3b40b..0a22e810b25f 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -51,12 +51,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index b792d935e578..cf81effeeb31 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -93,12 +93,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index ad673e9107ca..b598188d1d7e 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -59,28 +59,31 @@ fn G() -> i32 { // CHECK:STDOUT: } // 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: %i.patt: i32 = binding_pattern i +// 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.loc11_6.1: %.3 = param arr, runtime_param0 -// CHECK:STDOUT: @F.%arr: %.3 = bind_name arr, %arr.loc11_6.1 +// 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.loc11_21.1: i32 = param i, runtime_param1 -// CHECK:STDOUT: @F.%i: i32 = bind_name i, %i.loc11_21.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32.loc15, %.loc15_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32, %.loc15_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index 6e860c4a7a39..08dfb79bb5cc 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -46,8 +46,10 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @G.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @G.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index c1e329df6ac3..92b8d5a6ed43 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -153,8 +153,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .b_factory = %b_factory // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: %A.ref.loc17: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a_ref.var: ref %A = var a_ref // CHECK:STDOUT: %a_ref: ref %A = bind_name a_ref, %a_ref.var @@ -176,9 +176,9 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl y, element1 [template] -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %return.var: ref %A = var +// CHECK:STDOUT: %return: ref %A = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -200,18 +200,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make() -> @A.%return.var: %A { +// CHECK:STDOUT: fn @Make() -> %return: %A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc9_18: i32 = int_literal 1 [template = constants.%.6] // CHECK:STDOUT: %.loc9_26: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: %.loc9_27.1: %.3 = struct_literal (%.loc9_18, %.loc9_26) -// CHECK:STDOUT: %.loc9_27.2: ref i32 = class_element_access @A.%return.var, element0 +// CHECK:STDOUT: %.loc9_27.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_27.3: init i32 = initialize_from %.loc9_18 to %.loc9_27.2 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_27.4: ref i32 = class_element_access @A.%return.var, element1 +// CHECK:STDOUT: %.loc9_27.4: ref i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc9_27.5: init i32 = initialize_from %.loc9_26 to %.loc9_27.4 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_27.6: init %A = class_init (%.loc9_27.3, %.loc9_27.5), @A.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc9_27.6: init %A = class_init (%.loc9_27.3, %.loc9_27.5), %return [template = constants.%struct] // CHECK:STDOUT: %.loc9_28: init %A = converted %.loc9_27.1, %.loc9_27.6 [template = constants.%struct] -// CHECK:STDOUT: return %.loc9_28 to @A.%return.var +// CHECK:STDOUT: return %.loc9_28 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -285,7 +285,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -361,10 +361,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .d = @__global_init.%d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -455,8 +455,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .b_init = %b_init // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: %B.ref.loc13: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b_init.var: ref %B = var b_init @@ -577,12 +577,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 = import_ref Core//prelude/operators/as, inst+4, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+20, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type = 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.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.3 (constants.%.14)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -593,8 +593,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 1f8d0facbdd0..7ed94c12b386 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -44,11 +44,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -57,9 +57,9 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12_10: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32, %.loc12_15.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] +// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32.loc12, %.loc12_15.1 [template = i32] // CHECK:STDOUT: return %.loc12_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 09a006b03d58..da1aea38f6e4 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -58,12 +58,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 = import_ref Core//prelude/operators/as, inst+4, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.12)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+20, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type = 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.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index f5025410197d..787dc58505f6 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -56,12 +56,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index fc949a3abf99..1ec237edf72d 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -70,23 +70,27 @@ fn Initializing() { // CHECK:STDOUT: .Initializing = %Initializing.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} +// 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: %X.ref.loc17: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %n.loc17_10.1: %X = param n, runtime_param0 -// CHECK:STDOUT: @Value.%n: %X = bind_name n, %n.loc17_10.1 +// CHECK:STDOUT: %n.patt: %X = binding_pattern n +// 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: } // CHECK:STDOUT: %Reference.decl: %Reference.type = fn_decl @Reference [template = constants.%Reference] { -// CHECK:STDOUT: %X.ref.loc21: type = name_ref X, %X.decl [template = constants.%X] +// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p +// 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.loc21_14.1: %.5 = param p, runtime_param0 -// CHECK:STDOUT: @Reference.%p: %.5 = bind_name p, %p.loc21_14.1 +// CHECK:STDOUT: %p.param: %.5 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %X.ref.loc25: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: @Make.%return: ref %X = var +// 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] +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Initializing.decl: %Initializing.type = fn_decl @Initializing [template = constants.%Initializing] {} +// CHECK:STDOUT: %Initializing.decl: %Initializing.type = fn_decl @Initializing [template = constants.%Initializing] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { diff --git a/toolchain/check/testdata/as/no_prelude/tuple.carbon b/toolchain/check/testdata/as/no_prelude/tuple.carbon index 322e9391168c..141433e9e7e7 100644 --- a/toolchain/check/testdata/as/no_prelude/tuple.carbon +++ b/toolchain/check/testdata/as/no_prelude/tuple.carbon @@ -51,13 +51,13 @@ fn Var() { // CHECK:STDOUT: .Let = %Let.decl // CHECK:STDOUT: .Var = %Var.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %X.ref: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: @Make.%return: ref %X = var +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// 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] +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] {} -// CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [template = constants.%Var] {} +// CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] {} {} +// CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [template = constants.%Var] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 07cea00dc941..305d8014ed6a 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -78,12 +78,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 = import_ref Core//prelude/operators/as, inst+4, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.18)] -// CHECK:STDOUT: %import_ref.5: @As.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+20, loaded [symbolic = @As.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+20, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type = 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.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.3 (constants.%.18)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -93,28 +93,28 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] -// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %As.ref.loc15: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As] -// CHECK:STDOUT: %X.ref.loc15: type = name_ref X, %X.decl [template = constants.%X] +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %As.ref: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc15_20: type = interface_type @As, @As(constants.%X) [template = constants.%.8] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %X.ref.loc19: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %As.ref.loc19: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_18.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_18.2: type = converted %int.make_type_32.loc19, %.loc19_18.1 [template = i32] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %As.ref: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc19_18.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc19_18.2: type = converted %int.make_type_32, %.loc19_18.1 [template = i32] // CHECK:STDOUT: %.loc19_18.3: type = interface_type @As, @As(i32) [template = constants.%.13] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32.loc23, %.loc23_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @As(constants.%Dest: type) { @@ -138,36 +138,40 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: i32 as %.8 { // 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: } { // 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.loc16_14.1: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_14.2: i32 = bind_name self, %self.loc16_14.1 +// 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.var: ref %X = var +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.11] +// CHECK:STDOUT: %.loc15_24: = interface_witness (%Convert.decl) [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X as %.13 { // 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: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.loc20_14.1: %X = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_14.2: %X = bind_name self, %self.loc20_14.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.16] +// CHECK:STDOUT: %.loc19_24: = interface_witness (%Convert.decl) [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %.loc19 +// CHECK:STDOUT: witness = %.loc19_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -192,20 +196,20 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[@impl.1.%self.loc16_14.2: i32]() -> @impl.1.%return.var: %X { +// CHECK:STDOUT: fn @Convert.2[%self: i32]() -> %return: %X { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: i32 = name_ref self, @impl.1.%self.loc16_14.2 +// CHECK:STDOUT: %self.ref: i32 = name_ref self, %self // CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) -// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access @impl.1.%return.var, element0 +// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc16_51.3: init i32 = initialize_from %self.ref to %.loc16_51.2 -// CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), @impl.1.%return.var +// CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), %return // CHECK:STDOUT: %.loc16_52: init %X = converted %.loc16_51.1, %.loc16_51.4 -// CHECK:STDOUT: return %.loc16_52 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[@impl.2.%self.loc20_14.2: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self: %X]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %X = name_ref self, @impl.2.%self.loc20_14.2 +// CHECK:STDOUT: %self.ref: %X = name_ref self, %self // CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] // CHECK:STDOUT: %.loc20_45.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc20_45.2: i32 = bind_value %.loc20_45.1 @@ -222,7 +226,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %.loc23_26.1: type = interface_type @As, @As(constants.%X) [template = constants.%.8] // CHECK:STDOUT: %.loc23_26.2: %.9 = specific_constant imports.%import_ref.4, @As(constants.%X) [template = constants.%.10] // CHECK:STDOUT: %Convert.ref.loc23_26: %.9 = name_ref Convert, %.loc23_26.2 [template = constants.%.10] -// CHECK:STDOUT: %.loc23_26.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15, element0 [template = constants.%Convert.2] +// CHECK:STDOUT: %.loc23_26.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15_24, element0 [template = constants.%Convert.2] // CHECK:STDOUT: %.loc23_26.4: = bound_method %.loc23_16, %.loc23_26.3 [template = constants.%.19] // CHECK:STDOUT: %.loc23_26.5: ref %X = temporary_storage // CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %.loc23_26.4(%.loc23_16) to %.loc23_26.5 @@ -234,7 +238,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %.loc23_32.2: %.14 = specific_constant imports.%import_ref.4, @As(i32) [template = constants.%.15] // CHECK:STDOUT: %Convert.ref.loc23_32: %.14 = name_ref Convert, %.loc23_32.2 [template = constants.%.15] // CHECK:STDOUT: %.loc23_26.7: ref %X = temporary %.loc23_26.5, %.loc23_26.6 -// CHECK:STDOUT: %.loc23_32.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19, element0 [template = constants.%Convert.4] +// CHECK:STDOUT: %.loc23_32.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19_24, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc23_32.4: = bound_method %.loc23_26.7, %.loc23_32.3 // CHECK:STDOUT: %.loc23_26.8: %X = bind_value %.loc23_26.7 // CHECK:STDOUT: %Convert.call.loc23_32: init i32 = call %.loc23_32.4(%.loc23_26.8) diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 6ea4d876b05c..efc3bc262fa8 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index 10b3caab7ceb..9c2c62fbe669 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -45,8 +45,8 @@ fn Run() -> String {} // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: @Run.%return: ref String = var +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} { +// CHECK:STDOUT: %return: ref String = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 4391cf2427b4..e48cf27a40e6 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -45,11 +45,13 @@ fn Run(n: i32) {} // CHECK:STDOUT: } // 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: } { // 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.loc14_8.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Run.%n: i32 = bind_name n, %n.loc14_8.1 +// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 46048e71cd4d..0815a10ac075 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -51,12 +51,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 35f316a0b018..97635c93c684 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/basics/multifile.carbon b/toolchain/check/testdata/basics/multifile.carbon index aafae5667291..3a195adba8f7 100644 --- a/toolchain/check/testdata/basics/multifile.carbon +++ b/toolchain/check/testdata/basics/multifile.carbon @@ -45,7 +45,7 @@ fn B() {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -80,7 +80,7 @@ fn B() {} // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() { diff --git a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon index f66c859c9e12..9c3df72cbdd1 100644 --- a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon @@ -27,7 +27,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { 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 b845beb04a55..c303f2064eb9 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 @@ -87,7 +87,7 @@ fn B() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -197,7 +197,7 @@ fn B() { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.import = import A -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() { 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 ed9ad162e24e..f13315ed159e 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+14}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+15}} // 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+13, body: [block7]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+14, body: [block8]} // 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+15)': {kind: none, type: type(inst+1)} +// CHECK:STDOUT: 'type(inst+16)': {kind: none, type: type(inst+1)} // CHECK:STDOUT: 'type(inst+1)': {kind: none, type: type(inst+1)} -// CHECK:STDOUT: 'type(inst+8)': {kind: pointer, type: type(inst+17)} -// CHECK:STDOUT: 'type(inst+17)': {kind: copy, type: type(inst+17)} +// 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_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: @@ -51,102 +51,105 @@ fn Foo(n: ()) -> ((), ()) { // 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+5': {kind: BindName, arg0: entity_name0, arg1: inst+4, type: type(inst+1)} -// CHECK:STDOUT: 'inst+6': {kind: TupleLiteral, arg0: empty, 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+8': {kind: TupleType, arg0: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: block5, type: type(inst+8)} -// CHECK:STDOUT: 'inst+10': {kind: Converted, arg0: inst+6, arg1: inst+1, type: typeTypeType} +// 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+12': {kind: Converted, arg0: inst+9, arg1: inst+8, type: typeTypeType} -// CHECK:STDOUT: 'inst+13': {kind: VarStorage, arg0: nameReturnSlot, type: type(inst+8)} -// CHECK:STDOUT: 'inst+14': {kind: FunctionDecl, arg0: function0, arg1: block6, type: type(inst+15)} -// CHECK:STDOUT: 'inst+15': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} -// CHECK:STDOUT: 'inst+16': {kind: StructValue, arg0: empty, type: type(inst+15)} -// CHECK:STDOUT: 'inst+17': {kind: PointerType, arg0: type(inst+8), type: typeTypeType} -// CHECK:STDOUT: 'inst+18': {kind: NameRef, arg0: name1, arg1: inst+5, type: type(inst+1)} -// CHECK:STDOUT: 'inst+19': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+20': {kind: TupleLiteral, arg0: block8, type: type(inst+8)} -// CHECK:STDOUT: 'inst+21': {kind: TupleAccess, arg0: inst+13, arg1: element0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+22': {kind: TupleInit, arg0: block9, arg1: inst+21, type: type(inst+1)} -// CHECK:STDOUT: 'inst+23': {kind: TupleValue, arg0: empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+24': {kind: Converted, arg0: inst+18, arg1: inst+22, type: type(inst+1)} -// CHECK:STDOUT: 'inst+25': {kind: TupleAccess, arg0: inst+13, arg1: element1, type: type(inst+1)} -// CHECK:STDOUT: 'inst+26': {kind: TupleInit, arg0: empty, arg1: inst+25, type: type(inst+1)} -// CHECK:STDOUT: 'inst+27': {kind: Converted, arg0: inst+19, arg1: inst+26, type: type(inst+1)} -// CHECK:STDOUT: 'inst+28': {kind: TupleInit, arg0: block10, arg1: inst+13, type: type(inst+8)} -// CHECK:STDOUT: 'inst+29': {kind: TupleValue, arg0: block11, type: type(inst+8)} -// CHECK:STDOUT: 'inst+30': {kind: Converted, arg0: inst+20, arg1: inst+28, type: type(inst+8)} -// CHECK:STDOUT: 'inst+31': {kind: ReturnExpr, arg0: inst+30, arg1: inst+13} +// 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: 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+8': templateConstant(inst+8) -// CHECK:STDOUT: 'inst+10': templateConstant(inst+1) +// CHECK:STDOUT: 'inst+9': templateConstant(inst+9) // CHECK:STDOUT: 'inst+11': templateConstant(inst+1) -// CHECK:STDOUT: 'inst+12': templateConstant(inst+8) -// CHECK:STDOUT: 'inst+14': templateConstant(inst+16) -// CHECK:STDOUT: 'inst+15': templateConstant(inst+15) +// 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+17': templateConstant(inst+17) -// CHECK:STDOUT: 'inst+22': templateConstant(inst+23) -// CHECK:STDOUT: 'inst+23': templateConstant(inst+23) -// CHECK:STDOUT: 'inst+24': templateConstant(inst+23) -// CHECK:STDOUT: 'inst+26': templateConstant(inst+23) -// CHECK:STDOUT: 'inst+27': templateConstant(inst+23) -// CHECK:STDOUT: 'inst+28': templateConstant(inst+29) -// CHECK:STDOUT: 'inst+29': templateConstant(inst+29) -// CHECK:STDOUT: 'inst+30': templateConstant(inst+29) +// 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: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+14 +// CHECK:STDOUT: 0: inst+15 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block5: -// CHECK:STDOUT: 0: inst+6 -// CHECK:STDOUT: 1: inst+7 +// CHECK:STDOUT: 0: inst+7 +// CHECK:STDOUT: 1: inst+8 // CHECK:STDOUT: block6: +// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: block7: // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: 1: inst+3 // CHECK:STDOUT: 2: inst+4 // CHECK:STDOUT: 3: inst+5 -// CHECK:STDOUT: 4: inst+6 -// CHECK:STDOUT: 5: inst+7 -// CHECK:STDOUT: 6: inst+9 -// CHECK:STDOUT: 7: inst+10 -// CHECK:STDOUT: 8: inst+11 -// CHECK:STDOUT: 9: inst+12 -// CHECK:STDOUT: 10: inst+13 -// CHECK:STDOUT: block7: -// CHECK:STDOUT: 0: inst+18 -// CHECK:STDOUT: 1: inst+19 -// CHECK:STDOUT: 2: inst+20 -// CHECK:STDOUT: 3: inst+21 -// CHECK:STDOUT: 4: inst+22 -// CHECK:STDOUT: 5: inst+24 -// CHECK:STDOUT: 6: inst+25 -// CHECK:STDOUT: 7: inst+26 -// CHECK:STDOUT: 8: inst+27 -// CHECK:STDOUT: 9: inst+28 -// CHECK:STDOUT: 10: inst+30 -// CHECK:STDOUT: 11: inst+31 +// 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+18 -// CHECK:STDOUT: 1: inst+19 -// CHECK:STDOUT: block9: {} -// CHECK:STDOUT: block10: -// CHECK:STDOUT: 0: inst+24 -// CHECK:STDOUT: 1: inst+27 +// 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: block9: +// CHECK:STDOUT: 0: inst+19 +// CHECK:STDOUT: 1: inst+20 +// CHECK:STDOUT: block10: {} // CHECK:STDOUT: block11: -// CHECK:STDOUT: 0: inst+23 -// CHECK:STDOUT: 1: inst+23 +// CHECK:STDOUT: 0: inst+25 +// CHECK:STDOUT: 1: inst+28 // CHECK:STDOUT: block12: +// CHECK:STDOUT: 0: inst+24 +// CHECK:STDOUT: 1: inst+24 +// CHECK:STDOUT: block13: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+14 +// CHECK:STDOUT: 1: inst+15 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- raw_and_textual_ir.carbon @@ -166,17 +169,19 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { +// CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// 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.loc15_8.1: %.1 = param n, runtime_param0 -// CHECK:STDOUT: @Foo.%n: %.1 = bind_name n, %n.loc15_8.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) // CHECK:STDOUT: %.loc15_25.2: type = converted %.loc15_20, constants.%.1 [template = constants.%.1] // 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: @Foo.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon index c3a3b943ce37..31a51bf21598 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon @@ -43,31 +43,37 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { +// CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// 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.loc15_6.1: %.1 = param n, runtime_param0 -// CHECK:STDOUT: @A.%n: %.1 = bind_name n, %n.loc15_6.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: @A.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { +// CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// 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.loc19_6.1: %.1 = param n, runtime_param0 -// CHECK:STDOUT: @B.%n: %.1 = bind_name n, %n.loc19_6.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: @B.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // 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: } { // 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.loc23_6.1: %.1 = param r#if, runtime_param0 -// CHECK:STDOUT: @C.%if: %.1 = bind_name r#if, %if.loc23_6.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: @C.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index ede48e093070..0fbd20ff2e92 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -23,23 +23,23 @@ 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+16}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+18}} // 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+15, body: [block12]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+17, body: [block13]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst+16, bindings: block8} +// CHECK:STDOUT: generic0: {decl: inst+18, bindings: block9} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific0: {generic: generic0, args: block10} +// CHECK:STDOUT: specific0: {generic: generic0, args: block11} // 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+19)': {kind: none, type: type(inst+8)} -// CHECK:STDOUT: 'type(inst+8)': {kind: none, type: type(inst+8)} +// 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(symbolicConstant0)': {kind: copy, type: type(symbolicConstant0)} // CHECK:STDOUT: 'type(symbolicConstant1)': {kind: pointer, type: type(symbolicConstant4)} // CHECK:STDOUT: 'type(symbolicConstant4)': {kind: copy, type: type(symbolicConstant4)} @@ -49,128 +49,133 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: // CHECK:STDOUT: 0: typeTypeType -// CHECK:STDOUT: 1: type(inst+8) +// CHECK:STDOUT: 1: type(inst+10) // CHECK:STDOUT: type_block2: // CHECK:STDOUT: 0: type(symbolicConstant0) -// CHECK:STDOUT: 1: type(inst+8) +// CHECK:STDOUT: 1: type(inst+10) // CHECK:STDOUT: type_block3: // CHECK:STDOUT: 0: type(symbolicConstant2) -// CHECK:STDOUT: 1: type(inst+8) +// CHECK:STDOUT: 1: type(inst+10) // 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+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: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} -// CHECK:STDOUT: 'inst+5': {kind: Param, arg0: name2, arg1: runtime_param0, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+6': {kind: BindName, arg0: entity_name1, arg1: inst+5, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+7': {kind: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} -// CHECK:STDOUT: 'inst+8': {kind: TupleType, arg0: type_block0, type: typeTypeType} -// CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: empty, type: type(inst+8)} -// CHECK:STDOUT: 'inst+10': {kind: TupleType, arg0: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+11': {kind: TupleLiteral, arg0: block6, type: type(inst+10)} -// CHECK:STDOUT: 'inst+12': {kind: Converted, arg0: inst+9, arg1: inst+8, type: typeTypeType} -// CHECK:STDOUT: 'inst+13': {kind: TupleType, arg0: type_block2, type: typeTypeType} -// CHECK:STDOUT: 'inst+14': {kind: Converted, arg0: inst+11, arg1: inst+13, type: typeTypeType} -// CHECK:STDOUT: 'inst+15': {kind: VarStorage, arg0: nameReturnSlot, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+16': {kind: FunctionDecl, arg0: function0, arg1: block7, type: type(inst+19)} -// CHECK:STDOUT: 'inst+17': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: typeTypeType} -// CHECK:STDOUT: 'inst+18': {kind: TupleType, arg0: type_block3, type: typeTypeType} -// CHECK:STDOUT: 'inst+19': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} -// CHECK:STDOUT: 'inst+20': {kind: StructValue, arg0: empty, type: type(inst+19)} -// CHECK:STDOUT: 'inst+21': {kind: PointerType, arg0: type(symbolicConstant1), type: typeTypeType} -// CHECK:STDOUT: 'inst+22': {kind: NameRef, arg0: name2, arg1: inst+6, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+23': {kind: TupleLiteral, arg0: empty, type: type(inst+8)} -// CHECK:STDOUT: 'inst+24': {kind: TupleLiteral, arg0: block13, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+25': {kind: TupleAccess, arg0: inst+15, arg1: element0, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+26': {kind: InitializeFrom, arg0: inst+22, arg1: inst+25, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+27': {kind: TupleAccess, arg0: inst+15, arg1: element1, type: type(inst+8)} -// CHECK:STDOUT: 'inst+28': {kind: TupleInit, arg0: empty, arg1: inst+27, type: type(inst+8)} -// CHECK:STDOUT: 'inst+29': {kind: TupleValue, arg0: empty, type: type(inst+8)} -// CHECK:STDOUT: 'inst+30': {kind: Converted, arg0: inst+23, arg1: inst+28, type: type(inst+8)} -// CHECK:STDOUT: 'inst+31': {kind: TupleInit, arg0: block14, arg1: inst+15, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+32': {kind: Converted, arg0: inst+24, arg1: inst+31, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+33': {kind: ReturnExpr, arg0: inst+32, arg1: inst+15} +// 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: constant_values: // CHECK:STDOUT: 'inst+0': templateConstant(inst+0) // CHECK:STDOUT: 'inst+2': symbolicConstant2 // CHECK:STDOUT: 'inst+3': symbolicConstant0 -// CHECK:STDOUT: 'inst+4': symbolicConstant2 -// CHECK:STDOUT: 'inst+7': symbolicConstant2 -// CHECK:STDOUT: 'inst+8': templateConstant(inst+8) +// CHECK:STDOUT: 'inst+5': symbolicConstant2 +// CHECK:STDOUT: 'inst+9': symbolicConstant2 // CHECK:STDOUT: 'inst+10': templateConstant(inst+10) -// CHECK:STDOUT: 'inst+12': templateConstant(inst+8) -// CHECK:STDOUT: 'inst+13': symbolicConstant1 -// CHECK:STDOUT: 'inst+14': symbolicConstant3 -// CHECK:STDOUT: 'inst+16': templateConstant(inst+20) -// CHECK:STDOUT: 'inst+17': symbolicConstant2 -// CHECK:STDOUT: 'inst+18': symbolicConstant3 -// CHECK:STDOUT: 'inst+19': templateConstant(inst+19) -// CHECK:STDOUT: 'inst+20': templateConstant(inst+20) -// CHECK:STDOUT: 'inst+21': symbolicConstant4 -// CHECK:STDOUT: 'inst+28': templateConstant(inst+29) -// CHECK:STDOUT: 'inst+29': templateConstant(inst+29) -// CHECK:STDOUT: 'inst+30': templateConstant(inst+29) +// 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+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: symbolic_constants: // CHECK:STDOUT: symbolicConstant0: {inst: inst+3, generic: generic, index: genericInst} -// CHECK:STDOUT: symbolicConstant1: {inst: inst+13, 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+13, generic: generic0, index: genericInstInDecl1} -// CHECK:STDOUT: symbolicConstant4: {inst: inst+21, generic: generic, index: genericInst} +// CHECK:STDOUT: symbolicConstant3: {inst: inst+15, generic: generic0, index: genericInstInDecl1} +// CHECK:STDOUT: symbolicConstant4: {inst: inst+23, generic: generic, index: genericInst} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: 0: inst+18 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block5: -// CHECK:STDOUT: 0: inst+6 -// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+7 -// CHECK:STDOUT: 1: inst+9 +// CHECK:STDOUT: block6: +// CHECK:STDOUT: 0: inst+9 +// CHECK:STDOUT: 1: inst+11 // 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+4 -// CHECK:STDOUT: 3: inst+5 -// CHECK:STDOUT: 4: inst+6 -// CHECK:STDOUT: 5: inst+7 -// CHECK:STDOUT: 6: inst+9 -// CHECK:STDOUT: 7: inst+11 -// CHECK:STDOUT: 8: inst+12 -// CHECK:STDOUT: 9: inst+14 -// CHECK:STDOUT: 10: inst+15 -// CHECK:STDOUT: block8: -// CHECK:STDOUT: 0: 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+17 -// CHECK:STDOUT: 1: inst+18 +// CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block10: -// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 0: inst+19 +// CHECK:STDOUT: 1: inst+20 // CHECK:STDOUT: block11: // CHECK:STDOUT: 0: inst+3 -// CHECK:STDOUT: 1: inst+13 // CHECK:STDOUT: block12: -// CHECK:STDOUT: 0: inst+22 -// CHECK:STDOUT: 1: inst+23 -// CHECK:STDOUT: 2: inst+24 -// CHECK:STDOUT: 3: inst+25 -// CHECK:STDOUT: 4: inst+26 -// CHECK:STDOUT: 5: inst+27 -// CHECK:STDOUT: 6: inst+28 -// CHECK:STDOUT: 7: inst+30 -// CHECK:STDOUT: 8: inst+31 -// CHECK:STDOUT: 9: inst+32 -// CHECK:STDOUT: 10: inst+33 +// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 1: inst+15 // CHECK:STDOUT: block13: -// CHECK:STDOUT: 0: inst+22 -// CHECK:STDOUT: 1: inst+23 +// 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: block14: -// CHECK:STDOUT: 0: inst+26 -// CHECK:STDOUT: 1: inst+30 +// CHECK:STDOUT: 0: inst+24 +// CHECK:STDOUT: 1: inst+25 // CHECK:STDOUT: block15: +// CHECK:STDOUT: 0: inst+28 +// CHECK:STDOUT: 1: inst+32 +// CHECK:STDOUT: block16: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+16 +// CHECK:STDOUT: 1: inst+18 // 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 637384705b1e..b4686b3353e4 100644 --- a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon @@ -33,17 +33,19 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { +// CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// 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.loc15_8.1: %.1 = param n, runtime_param0 -// CHECK:STDOUT: @Foo.%n: %.1 = bind_name n, %n.loc15_8.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) // CHECK:STDOUT: %.loc15_25.2: type = converted %.loc15_20, constants.%.1 [template = constants.%.1] // 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: @Foo.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 1ab28a64da38..b2024125294c 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -89,7 +89,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/basics/run.carbon b/toolchain/check/testdata/basics/run.carbon index e6ad1fdb916d..a7e275cf2e7b 100644 --- a/toolchain/check/testdata/basics/run.carbon +++ b/toolchain/check/testdata/basics/run.carbon @@ -37,7 +37,7 @@ fn Run() {} // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index 9a2581017ef6..444d78957d79 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -42,11 +42,11 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { +// 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] // 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: @Run.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,7 +54,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: i32 = int_literal 0 [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_26: i32 = int_literal 0 [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_26 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 27a1e1738803..69c7c4cb6518 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+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -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+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -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+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+25, loaded [template = constants.%UInt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -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+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+25, loaded [template = constants.%UInt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index 6856ccb84a71..83d48650bc92 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -49,8 +49,8 @@ var b: Bool() = false; // CHECK:STDOUT: .Bool = %Bool.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Bool.decl: %Bool.type = fn_decl @Bool [template = constants.%Bool] { -// CHECK:STDOUT: @Bool.%return: ref type = var +// CHECK:STDOUT: %Bool.decl: %Bool.type = fn_decl @Bool [template = constants.%Bool] {} { +// CHECK:STDOUT: %return: ref type = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index 1651d5eb3355..ba8260339a03 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,47 +90,53 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_8.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: f64 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: f64 = bind_name b, %b.loc2_16.1 +// 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: @Add.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc4_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc4_16.1 +// 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.loc4_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc4_24.1 +// 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: @RuntimeCall.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -198,7 +204,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -215,135 +221,156 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: f64 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc13_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: f64 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: f64 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: f64 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc17_18.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: f64 = bind_name a, %a.loc17_18.1 +// 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.loc17_26.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: f64 = bind_name b, %b.loc17_26.1 -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc18_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: f64 = bind_name a, %a.loc18_14.1 +// 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.loc18_22.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: f64 = bind_name b, %b.loc18_22.1 +// 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: @JustRight.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc20_22.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: f64 = bind_name a, %a.loc20_22.1 +// 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: @RuntimeCallTooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc24_23.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: f64 = bind_name a, %a.loc24_23.1 +// 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.loc24_31.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: f64 = bind_name b, %b.loc24_31.1 +// 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.loc24_39.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: f64 = bind_name c, %c.loc24_39.1 +// 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: @RuntimeCallTooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc28_29.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: f64 = bind_name a, %a.loc28_29.1 +// 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.loc28_37.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: f64 = bind_name b, %b.loc28_37.1 -// CHECK:STDOUT: %bool.make_type.loc28: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type.loc28 [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type.loc28, %.loc28_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index 830c2c9ce7d7..9de52e7fc60a 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,55 +92,61 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Div = %Div.decl // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .a = %a.loc8 +// CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_8.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: f64 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: f64 = bind_name b, %b.loc2_16.1 +// 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: @Div.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc4_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc4_16.1 +// 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.loc4_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc4_24.1 +// 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: @RuntimeCall.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] // CHECK:STDOUT: %a.var: ref f64 = var a -// CHECK:STDOUT: %a.loc8: ref f64 = bind_name a, %a.var +// CHECK:STDOUT: %a: ref f64 = bind_name a, %a.var // CHECK:STDOUT: %.loc9_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc9: init type = call constants.%Float(%.loc9_8.1) [template = f64] // CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %float.make_type.loc9 [template = f64] @@ -228,7 +234,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -245,135 +251,156 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: f64 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc13_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: f64 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: f64 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: f64 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc17_18.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: f64 = bind_name a, %a.loc17_18.1 +// 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.loc17_26.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: f64 = bind_name b, %b.loc17_26.1 -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc18_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: f64 = bind_name a, %a.loc18_14.1 +// 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.loc18_22.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: f64 = bind_name b, %b.loc18_22.1 +// 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: @JustRight.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc20_22.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: f64 = bind_name a, %a.loc20_22.1 +// 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: @RuntimeCallTooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc24_23.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: f64 = bind_name a, %a.loc24_23.1 +// 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.loc24_31.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: f64 = bind_name b, %b.loc24_31.1 +// 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.loc24_39.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: f64 = bind_name c, %c.loc24_39.1 +// 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: @RuntimeCallTooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc28_29.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: f64 = bind_name a, %a.loc28_29.1 +// 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.loc28_37.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: f64 = bind_name b, %b.loc28_37.1 -// CHECK:STDOUT: %bool.make_type.loc28: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type.loc28 [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type.loc28, %.loc28_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index c9bee6442ea5..3b012f8382dd 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,50 +87,59 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_7.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Eq.%a: f64 = bind_name a, %a.loc2_7.1 +// 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.loc2_15.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Eq.%b: f64 = bind_name b, %b.loc2_15.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type.loc2, %.loc2_26.1 [template = bool] -// CHECK:STDOUT: @Eq.%return: ref bool = var +// 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: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} +// 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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc7_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc7_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc7_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc12_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc12_16.1 +// 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.loc12_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc12_24.1 -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type.loc12, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -231,7 +240,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -241,23 +250,26 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc7_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @WrongResult.%a: f64 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @WrongResult.%b: f64 = bind_name b, %b.loc7_24.1 +// 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: @WrongResult.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 712ad6639e78..4ad76d17c412 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,63 +87,74 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Greater.%a: f64 = bind_name a, %a.loc2_12.1 +// 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.loc2_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Greater.%b: f64 = bind_name b, %b.loc2_20.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type.loc2, %.loc2_31.1 [template = bool] -// CHECK:STDOUT: @Greater.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc3_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: f64 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc16_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 0c8ffc9f6211..e2f35e545d37 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,63 +87,74 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @GreaterEq.%a: f64 = bind_name a, %a.loc2_14.1 +// 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.loc2_22.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @GreaterEq.%b: f64 = bind_name b, %b.loc2_22.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type.loc2, %.loc2_33.1 [template = bool] -// CHECK:STDOUT: @GreaterEq.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc3_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: f64 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc16_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index ce67aaa0e314..3f7d08de6482 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,63 +87,74 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_9.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Less.%a: f64 = bind_name a, %a.loc2_9.1 +// 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.loc2_17.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Less.%b: f64 = bind_name b, %b.loc2_17.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type.loc2, %.loc2_28.1 [template = bool] -// CHECK:STDOUT: @Less.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc3_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: f64 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc16_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index 82effca5c663..e4c15d972013 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,63 +87,74 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @LessEq.%a: f64 = bind_name a, %a.loc2_11.1 +// 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.loc2_19.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @LessEq.%b: f64 = bind_name b, %b.loc2_19.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type.loc2, %.loc2_30.1 [template = bool] -// CHECK:STDOUT: @LessEq.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc3_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: f64 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc16_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index afcc3fc0a6a4..f4150b89a2c6 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -76,12 +76,14 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // 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: } { // 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.loc4_10.1: i32 = param size, runtime_param0 -// CHECK:STDOUT: @Float.%size: i32 = bind_name size, %size.loc4_10.1 -// CHECK:STDOUT: @Float.%return: ref type = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,7 +106,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+15, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+16, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -136,12 +138,14 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %f.var: ref f64 = var f // 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: } { // 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.loc8_13.1: i32 = param dyn_size, runtime_param0 -// CHECK:STDOUT: @GetFloat.%dyn_size: i32 = bind_name dyn_size, %dyn_size.loc8_13.1 -// CHECK:STDOUT: @GetFloat.%return: ref type = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -179,7 +183,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+15, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+16, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index d3cb45ee31dd..37320186d601 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,47 +90,53 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_8.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Mul.%a: f64 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Mul.%b: f64 = bind_name b, %b.loc2_16.1 +// 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: @Mul.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc4_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc4_16.1 +// 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.loc4_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc4_24.1 +// 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: @RuntimeCall.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -198,7 +204,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -215,135 +221,156 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: f64 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc13_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: f64 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: f64 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: f64 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc17_18.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: f64 = bind_name a, %a.loc17_18.1 +// 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.loc17_26.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: f64 = bind_name b, %b.loc17_26.1 -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc18_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: f64 = bind_name a, %a.loc18_14.1 +// 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.loc18_22.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: f64 = bind_name b, %b.loc18_22.1 +// 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: @JustRight.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc20_22.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: f64 = bind_name a, %a.loc20_22.1 +// 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: @RuntimeCallTooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc24_23.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: f64 = bind_name a, %a.loc24_23.1 +// 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.loc24_31.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: f64 = bind_name b, %b.loc24_31.1 +// 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.loc24_39.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: f64 = bind_name c, %c.loc24_39.1 +// 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: @RuntimeCallTooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc28_29.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: f64 = bind_name a, %a.loc28_29.1 +// 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.loc28_37.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: f64 = bind_name b, %b.loc28_37.1 -// CHECK:STDOUT: %bool.make_type.loc28: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type.loc28 [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type.loc28, %.loc28_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 0d3941c20290..16efd8fa0dc5 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -110,41 +110,46 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: } { // 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.loc2_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: f64 = bind_name a, %a.loc2_11.1 +// 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: @Negate.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc4_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc4_16.1 +// 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.loc4_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc4_24.1 +// 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: @RuntimeCall.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type [template = f64] +// 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"; @@ -210,7 +215,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -226,112 +231,128 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { +// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] {} { // CHECK:STDOUT: %.loc8_16.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_16.1) [template = f64] -// CHECK:STDOUT: %.loc8_16.2: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_16.3: type = converted %float.make_type.loc8, %.loc8_16.2 [template = f64] -// CHECK:STDOUT: @TooFew.%return: ref f64 = var +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_16.1) [template = f64] +// CHECK:STDOUT: %.loc8_16.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc8_16.3: type = converted %float.make_type, %.loc8_16.2 [template = f64] +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc13_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: f64 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: f64 = bind_name b, %b.loc13_20.1 +// 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: @TooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_21.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %float.make_type.loc18: init type = call constants.%Float(%.loc18_21.1) [template = f64] -// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type.loc18 [template = f64] -// CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type.loc18, %.loc18_21.2 [template = f64] -// CHECK:STDOUT: %a.loc18_18.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: f64 = bind_name a, %a.loc18_18.1 -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc19_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: f64 = bind_name a, %a.loc19_14.1 +// 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: @JustRight.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc21_22.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: f64 = bind_name a, %a.loc21_22.1 +// 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: @RuntimeCallTooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc32_23.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: f64 = bind_name a, %a.loc32_23.1 +// 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.loc32_31.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: f64 = bind_name b, %b.loc32_31.1 +// 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.loc32_39.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: f64 = bind_name c, %c.loc32_39.1 +// 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: @RuntimeCallTooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc43_29.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: f64 = bind_name a, %a.loc43_29.1 +// 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.loc43_37.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: f64 = bind_name b, %b.loc43_37.1 -// CHECK:STDOUT: %bool.make_type.loc43: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc43_48.1: type = value_of_initializer %bool.make_type.loc43 [template = bool] -// CHECK:STDOUT: %.loc43_48.2: type = converted %bool.make_type.loc43, %.loc43_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index 6ba9f1c068f6..1193e4cfd883 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -87,50 +87,59 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_8.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Neq.%a: f64 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Neq.%b: f64 = bind_name b, %b.loc2_16.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type.loc2, %.loc2_27.1 [template = bool] -// CHECK:STDOUT: @Neq.%return: ref bool = var +// 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: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} +// 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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc7_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc7_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc7_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc12_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc12_16.1 +// 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.loc12_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc12_24.1 -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type.loc12, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -231,7 +240,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -241,23 +250,26 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc7_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @WrongResult.%a: f64 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @WrongResult.%b: f64 = bind_name b, %b.loc7_24.1 +// 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: @WrongResult.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index c8889225a2b0..2a77014b3c3e 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,47 +90,53 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: %b.patt: f64 = binding_pattern b +// 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.loc2_8.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: f64 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: f64 = bind_name b, %b.loc2_16.1 +// 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: @Sub.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc4_16.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: f64 = bind_name a, %a.loc4_16.1 +// 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.loc4_24.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: f64 = bind_name b, %b.loc4_24.1 +// 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: @RuntimeCall.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // 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] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -198,7 +204,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: @@ -215,135 +221,156 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: f64 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc13_12.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: f64 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: f64 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: f64 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc17_18.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: f64 = bind_name a, %a.loc17_18.1 +// 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.loc17_26.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: f64 = bind_name b, %b.loc17_26.1 -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc18_14.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: f64 = bind_name a, %a.loc18_14.1 +// 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.loc18_22.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: f64 = bind_name b, %b.loc18_22.1 +// 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: @JustRight.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// 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.loc20_22.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: f64 = bind_name a, %a.loc20_22.1 +// 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: @RuntimeCallTooFew.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// 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.loc24_23.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: f64 = bind_name a, %a.loc24_23.1 +// 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.loc24_31.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: f64 = bind_name b, %b.loc24_31.1 +// 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.loc24_39.1: f64 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: f64 = bind_name c, %c.loc24_39.1 +// 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: @RuntimeCallTooMany.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// 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.loc28_29.1: f64 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: f64 = bind_name a, %a.loc28_29.1 +// 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.loc28_37.1: f64 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: f64 = bind_name b, %b.loc28_37.1 -// CHECK:STDOUT: %bool.make_type.loc28: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type.loc28 [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type.loc28, %.loc28_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 1560cf330164..0b61d78b68c0 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -61,20 +61,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @And.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @And.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @And.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -93,20 +96,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index f8ba805057ec..c947e6fb4730 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -66,31 +66,36 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc2_15.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Complement.%a: i32 = bind_name a, %a.loc2_15.1 +// 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: @Complement.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc3_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @And.%a: i32 = bind_name a, %a.loc3_8.1 +// 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.loc3_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @And.%b: i32 = bind_name b, %b.loc3_16.1 +// 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: @And.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -113,15 +118,17 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18, i32 [template = constants.%.6] // 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: } { // 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.loc8_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc8_16.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 1a7a11974eb5..2ebabde5e849 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -86,46 +86,55 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_7.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Eq.%a: i32 = bind_name a, %a.loc2_7.1 +// 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.loc2_15.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Eq.%b: i32 = bind_name b, %b.loc2_15.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type.loc2, %.loc2_26.1 [template = bool] -// CHECK:STDOUT: @Eq.%return: ref bool = var +// 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: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} +// 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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc7_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc7_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc7_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc12_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc12_16.1 +// 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.loc12_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc12_24.1 -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type.loc12, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -235,20 +244,23 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @WrongResult.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @WrongResult.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @WrongResult.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index b1554ad82b9b..841e35038b8d 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -86,57 +86,68 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Greater.%a: i32 = bind_name a, %a.loc2_12.1 +// 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.loc2_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Greater.%b: i32 = bind_name b, %b.loc2_20.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type.loc2, %.loc2_31.1 [template = bool] -// CHECK:STDOUT: @Greater.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc3_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc16_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index fff5948a4586..f041eb1f3c86 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -86,57 +86,68 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @GreaterEq.%a: i32 = bind_name a, %a.loc2_14.1 +// 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.loc2_22.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @GreaterEq.%b: i32 = bind_name b, %b.loc2_22.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type.loc2, %.loc2_33.1 [template = bool] -// CHECK:STDOUT: @GreaterEq.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc3_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc16_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 036c8e062fd1..16f1e597958d 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -105,20 +105,23 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @LeftShift.%a: i32 = bind_name a, %a.loc2_14.1 +// 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.loc2_22.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @LeftShift.%b: i32 = bind_name b, %b.loc2_22.1 +// 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: @LeftShift.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -137,20 +140,23 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,31 +234,36 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @LeftShift.%a: i32 = bind_name a, %a.loc4_14.1 +// 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.loc4_22.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @LeftShift.%b: i32 = bind_name b, %b.loc4_22.1 +// 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: @LeftShift.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc5_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc5_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 24e50e9d9c1f..8d7d46002a94 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -86,57 +86,68 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_9.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Less.%a: i32 = bind_name a, %a.loc2_9.1 +// 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.loc2_17.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Less.%b: i32 = bind_name b, %b.loc2_17.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type.loc2, %.loc2_28.1 [template = bool] -// CHECK:STDOUT: @Less.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc3_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc16_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index ffd516ca3b78..e16160789204 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -86,57 +86,68 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @LessEq.%a: i32 = bind_name a, %a.loc2_11.1 +// 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.loc2_19.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @LessEq.%b: i32 = bind_name b, %b.loc2_19.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type.loc2, %.loc2_30.1 [template = bool] -// CHECK:STDOUT: @LessEq.%return: ref bool = var +// 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: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc3_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc3_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc8_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc8_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc8_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc16_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc16_16.1 +// 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.loc16_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc16_24.1 -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type.loc16, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index 4e922765b1a8..e931b296ac9c 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -49,8 +49,8 @@ var i: Int() = 0; // CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { -// CHECK:STDOUT: @Int.%return: ref type = var +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] {} { +// CHECK:STDOUT: %return: ref type = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 8de12f277622..e6203ac1923a 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -101,12 +101,14 @@ var m: Int(1000000000); // CHECK:STDOUT: } // 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: } { // 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.loc4_8.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Int.%n: i32 = bind_name n, %n.loc4_8.1 -// CHECK:STDOUT: @Int.%return: ref type = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -137,7 +139,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -163,54 +165,61 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // 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: } { // 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.loc6_6.1: %.3 = param n, runtime_param0 -// CHECK:STDOUT: @F.%n: %.3 = bind_name n, %n.loc6_6.1 +// 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: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %n.patt: %.5 = binding_pattern n +// 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.loc10_6.1: %.5 = param n, runtime_param0 -// CHECK:STDOUT: @G.%n: %.5 = bind_name n, %n.loc10_6.1 +// 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: @G.%return: ref %.5 = var +// CHECK:STDOUT: %return: ref %.5 = var // 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: %x.patt: @Symbolic.%.1 (%.6) = binding_pattern x +// 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.loc14_13.1: i32 = param N, runtime_param -// CHECK:STDOUT: @Symbolic.%N.loc14: i32 = bind_symbolic_name N 0, %N.loc14_13.1 [symbolic = @Symbolic.%N.1 (constants.%N)] +// CHECK:STDOUT: %N.param: i32 = param N, runtime_param +// CHECK:STDOUT: %N.loc14: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (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, @Symbolic.%N.loc14 [symbolic = @Symbolic.%N.1 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_28: init type = call %Int.ref.loc14_25(%N.ref.loc14_29) [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_30.1: type = value_of_initializer %int.make_type_signed.loc14_28 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_30.2: type = converted %int.make_type_signed.loc14_28, %.loc14_30.1 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %x.loc14_22.1: @Symbolic.%.1 (%.6) = param x, runtime_param0 -// CHECK:STDOUT: @Symbolic.%x: @Symbolic.%.1 (%.6) = bind_name x, %x.loc14_22.1 +// CHECK:STDOUT: %N.ref.loc14_29: i32 = name_ref N, %N.loc14 [symbolic = %N.1 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed.loc14_28: init type = call %Int.ref.loc14_25(%N.ref.loc14_29) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_30.1: type = value_of_initializer %int.make_type_signed.loc14_28 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_30.2: type = converted %int.make_type_signed.loc14_28, %.loc14_30.1 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %x.param: @Symbolic.%.1 (%.6) = param x, runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%.1 (%.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, @Symbolic.%N.loc14 [symbolic = @Symbolic.%N.1 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_36(%N.ref.loc14_40) [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_41.2: type = converted %int.make_type_signed.loc14_39, %.loc14_41.1 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: @Symbolic.%return: ref @Symbolic.%.1 (%.6) = var +// CHECK:STDOUT: %N.ref.loc14_40: i32 = name_ref N, %N.loc14 [symbolic = %N.1 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_36(%N.ref.loc14_40) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_41.2: type = converted %int.make_type_signed.loc14_39, %.loc14_41.1 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %return: ref @Symbolic.%.1 (%.6) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -258,7 +267,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -305,7 +314,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -325,20 +334,22 @@ var m: Int(1000000000); // CHECK:STDOUT: .Int = imports.%import_ref.1 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n.loc12 +// CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // 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: } { // 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.loc6_11.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Negate.%n: i32 = bind_name n, %n.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -350,7 +361,7 @@ var m: Int(1000000000); // 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 -// CHECK:STDOUT: %n.loc12: ref = bind_name n, %n.var +// CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -369,7 +380,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] // 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/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index c03c9536c5bc..5fa1cca77692 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -101,12 +101,14 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // 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: } { // 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.loc4_9.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @UInt.%n: i32 = bind_name n, %n.loc4_9.1 -// CHECK:STDOUT: @UInt.%return: ref type = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -137,7 +139,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -163,54 +165,61 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Core.import = import Core // 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: } { // 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.loc6_6.1: %.3 = param n, runtime_param0 -// CHECK:STDOUT: @F.%n: %.3 = bind_name n, %n.loc6_6.1 +// 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: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %n.patt: %.5 = binding_pattern n +// 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.loc10_6.1: %.5 = param n, runtime_param0 -// CHECK:STDOUT: @G.%n: %.5 = bind_name n, %n.loc10_6.1 +// 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: @G.%return: ref %.5 = var +// CHECK:STDOUT: %return: ref %.5 = var // 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: %x.patt: @Symbolic.%.1 (%.6) = binding_pattern x +// 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.loc14_13.1: i32 = param N, runtime_param -// CHECK:STDOUT: @Symbolic.%N.loc14: i32 = bind_symbolic_name N 0, %N.loc14_13.1 [symbolic = @Symbolic.%N.1 (constants.%N)] +// CHECK:STDOUT: %N.param: i32 = param N, runtime_param +// CHECK:STDOUT: %N.loc14: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (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, @Symbolic.%N.loc14 [symbolic = @Symbolic.%N.1 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_29: init type = call %UInt.ref.loc14_25(%N.ref.loc14_30) [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_unsigned.loc14_29 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_unsigned.loc14_29, %.loc14_31.1 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %x.loc14_22.1: @Symbolic.%.1 (%.6) = param x, runtime_param0 -// CHECK:STDOUT: @Symbolic.%x: @Symbolic.%.1 (%.6) = bind_name x, %x.loc14_22.1 +// CHECK:STDOUT: %N.ref.loc14_30: i32 = name_ref N, %N.loc14 [symbolic = %N.1 (constants.%N)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_29: init type = call %UInt.ref.loc14_25(%N.ref.loc14_30) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_unsigned.loc14_29 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_unsigned.loc14_29, %.loc14_31.1 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %x.param: @Symbolic.%.1 (%.6) = param x, runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%.1 (%.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, @Symbolic.%N.loc14 [symbolic = @Symbolic.%N.1 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_41: init type = call %UInt.ref.loc14_37(%N.ref.loc14_42) [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_unsigned.loc14_41 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: %.loc14_43.2: type = converted %int.make_type_unsigned.loc14_41, %.loc14_43.1 [symbolic = @Symbolic.%.1 (constants.%.6)] -// CHECK:STDOUT: @Symbolic.%return: ref @Symbolic.%.1 (%.6) = var +// CHECK:STDOUT: %N.ref.loc14_42: i32 = name_ref N, %N.loc14 [symbolic = %N.1 (constants.%N)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_41: init type = call %UInt.ref.loc14_37(%N.ref.loc14_42) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_unsigned.loc14_41 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.loc14_43.2: type = converted %int.make_type_unsigned.loc14_41, %.loc14_43.1 [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %return: ref @Symbolic.%.1 (%.6) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -258,7 +267,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -305,7 +314,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -325,20 +334,22 @@ var m: UInt(1000000000); // CHECK:STDOUT: .UInt = imports.%import_ref.1 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n.loc12 +// CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // 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: } { // 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.loc6_11.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Negate.%n: i32 = bind_name n, %n.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -350,7 +361,7 @@ var m: UInt(1000000000); // 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 -// CHECK:STDOUT: %n.loc12: ref = bind_name n, %n.var +// CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -369,7 +380,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] // 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/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 73762b33b68d..381049e4a8dd 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -77,46 +77,55 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Neq.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Neq.%b: i32 = bind_name b, %b.loc2_16.1 -// CHECK:STDOUT: %bool.make_type.loc2: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type.loc2 [template = bool] -// CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type.loc2, %.loc2_27.1 [template = bool] -// CHECK:STDOUT: @Neq.%return: ref bool = var +// 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: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} +// 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.ref: type = name_ref True, %True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.loc7_6.1: %True = param true_, runtime_param0 -// CHECK:STDOUT: @F.%true_: %True = bind_name true_, %true_.loc7_6.1 -// CHECK:STDOUT: %False.ref: type = name_ref False, %False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.loc7_19.1: %False = param false_, runtime_param1 -// CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 +// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// 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: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc12_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc12_16.1 +// 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.loc12_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc12_24.1 -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type.loc12, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: @RuntimeCall.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 6992f30786e6..3fad5309af19 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -61,20 +61,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_7.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Or.%a: i32 = bind_name a, %a.loc2_7.1 +// 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.loc2_15.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Or.%b: i32 = bind_name b, %b.loc2_15.1 +// 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: @Or.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -93,20 +96,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 5c5432de29c2..3b2ea989c21d 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -106,20 +106,23 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_15.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc2_15.1 +// 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.loc2_23.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RightShift.%b: i32 = bind_name b, %b.loc2_23.1 +// 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: @RightShift.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -138,20 +141,23 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,31 +234,36 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc6_15.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc6_15.1 +// 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.loc6_23.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RightShift.%b: i32 = bind_name b, %b.loc6_23.1 +// 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: @RightShift.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc7_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc7_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -366,31 +377,36 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_15.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc4_15.1 +// 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.loc4_23.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RightShift.%b: i32 = bind_name b, %b.loc4_23.1 +// 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: @RightShift.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc5_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc5_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 9c85c57daa17..1aa505372b83 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -131,20 +131,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -163,20 +166,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,68 +270,80 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: i32 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc13_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: i32 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: i32 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: i32 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc18_18.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: i32 = bind_name a, %a.loc18_18.1 +// 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.loc18_26.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: i32 = bind_name b, %b.loc18_26.1 -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type.loc18, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc19_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: i32 = bind_name a, %a.loc19_14.1 +// 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.loc19_22.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: i32 = bind_name b, %b.loc19_22.1 +// 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: @JustRight.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -359,52 +377,61 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %bad_call.var: ref = var bad_call // 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: } { // 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.loc46_22.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: i32 = bind_name a, %a.loc46_22.1 +// 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: @RuntimeCallTooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc50_23.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: i32 = bind_name a, %a.loc50_23.1 +// 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.loc50_31.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: i32 = bind_name b, %b.loc50_31.1 +// 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.loc50_39.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: i32 = bind_name c, %c.loc50_39.1 +// 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: @RuntimeCallTooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc54_29.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: i32 = bind_name a, %a.loc54_29.1 +// 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.loc54_37.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: i32 = bind_name b, %b.loc54_37.1 -// CHECK:STDOUT: %bool.make_type.loc54: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type.loc54 [template = bool] -// CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type.loc54, %.loc54_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -491,20 +518,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 381fca524640..990c83cdfb0f 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -99,20 +99,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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,20 +134,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -217,47 +223,55 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc6_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -370,20 +384,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 269c7341ed98..9806fe6f6811 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -102,20 +102,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -134,20 +137,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,47 +227,55 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc6_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -374,20 +388,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 67904722720f..de0a48d7513d 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -73,20 +73,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mul.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Mul.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -105,20 +108,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -184,20 +190,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mul.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mul.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index ee86b87b4d31..f9a4ded6a65b 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -160,15 +160,17 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // 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: } { // 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.loc2_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc2_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -193,20 +195,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // 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: %b.patt: i32 = binding_pattern b +// 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.loc9_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc9_16.1 +// 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.loc9_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc9_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -297,49 +302,56 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32.loc8, %.loc8_16.1 [template = i32] -// CHECK:STDOUT: @TooFew.%return: ref i32 = var +// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32, %.loc8_16.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc13_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: i32 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: i32 = bind_name b, %b.loc13_20.1 +// 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: @TooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.loc18_18.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: i32 = bind_name a, %a.loc18_18.1 -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc19_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: i32 = bind_name a, %a.loc19_14.1 +// 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: @JustRight.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -369,52 +381,61 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %bad_call.var: ref = var bad_call // 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: } { // 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.loc46_22.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: i32 = bind_name a, %a.loc46_22.1 +// 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: @RuntimeCallTooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc57_23.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: i32 = bind_name a, %a.loc57_23.1 +// 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.loc57_31.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: i32 = bind_name b, %b.loc57_31.1 +// 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.loc57_39.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: i32 = bind_name c, %c.loc57_39.1 +// 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: @RuntimeCallTooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc68_29.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: i32 = bind_name a, %a.loc68_29.1 +// 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.loc68_37.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: i32 = bind_name b, %b.loc68_37.1 -// CHECK:STDOUT: %bool.make_type.loc68: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type.loc68 [template = bool] -// CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type.loc68, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -495,31 +516,36 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // 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: } { // 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.loc4_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc4_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 1bea35887db1..bf473552b4e6 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -74,20 +74,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -106,20 +109,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,20 +193,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 7cbc8330fbf1..7ff00a57a130 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -128,20 +128,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -160,20 +163,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -261,68 +267,80 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: } { // 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.loc8_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooFew.%a: i32 = bind_name a, %a.loc8_11.1 +// 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: @TooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc13_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: i32 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: i32 = bind_name b, %b.loc13_20.1 +// 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.loc13_28.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @TooMany.%c: i32 = bind_name c, %c.loc13_28.1 +// 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: @TooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc18_18.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: i32 = bind_name a, %a.loc18_18.1 +// 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.loc18_26.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @BadReturnType.%b: i32 = bind_name b, %b.loc18_26.1 -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type.loc18, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc19_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: i32 = bind_name a, %a.loc19_14.1 +// 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.loc19_22.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @JustRight.%b: i32 = bind_name b, %b.loc19_22.1 +// 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: @JustRight.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -356,52 +374,61 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %bad_call.var: ref = var bad_call // 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: } { // 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.loc45_22.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: i32 = bind_name a, %a.loc45_22.1 +// 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: @RuntimeCallTooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc49_23.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: i32 = bind_name a, %a.loc49_23.1 +// 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.loc49_31.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: i32 = bind_name b, %b.loc49_31.1 +// 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.loc49_39.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: i32 = bind_name c, %c.loc49_39.1 +// 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: @RuntimeCallTooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc53_29.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: i32 = bind_name a, %a.loc53_29.1 +// 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.loc53_37.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: i32 = bind_name b, %b.loc53_37.1 -// CHECK:STDOUT: %bool.make_type.loc53: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type.loc53 [template = bool] -// CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type.loc53, %.loc53_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -488,20 +515,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index d2cbf673a187..8522b4295a8d 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -95,20 +95,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -127,20 +130,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -214,47 +220,55 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc6_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -367,20 +381,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Div.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Div.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 70c79bde287c..562d2a72d757 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -97,20 +97,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -129,20 +132,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -216,47 +222,55 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc6_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc6_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -369,20 +383,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mod.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index d3302d9fc522..4497fc3bc28d 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -70,20 +70,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mul.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Mul.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -102,20 +105,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -181,20 +187,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Mul.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Mul.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index c4de1fd344ca..d1580f3b282c 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -156,15 +156,17 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // 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: } { // 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.loc2_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc2_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -189,20 +191,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // 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: %b.patt: i32 = binding_pattern b +// 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.loc9_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc9_16.1 +// 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.loc9_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc9_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -293,49 +298,56 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32.loc8, %.loc8_16.1 [template = i32] -// CHECK:STDOUT: @TooFew.%return: ref i32 = var +// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32, %.loc8_16.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc13_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TooMany.%a: i32 = bind_name a, %a.loc13_12.1 +// 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.loc13_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @TooMany.%b: i32 = bind_name b, %b.loc13_20.1 +// 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: @TooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.loc18_18.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @BadReturnType.%a: i32 = bind_name a, %a.loc18_18.1 -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: @BadReturnType.%return: ref bool = var +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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.loc19_14.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @JustRight.%a: i32 = bind_name a, %a.loc19_14.1 +// 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: @JustRight.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -365,52 +377,61 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %bad_call.var: ref = var bad_call // 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: } { // 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.loc46_22.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooFew.%a: i32 = bind_name a, %a.loc46_22.1 +// 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: @RuntimeCallTooFew.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// 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.loc57_23.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallTooMany.%a: i32 = bind_name a, %a.loc57_23.1 +// 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.loc57_31.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallTooMany.%b: i32 = bind_name b, %b.loc57_31.1 +// 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.loc57_39.1: i32 = param c, runtime_param2 -// CHECK:STDOUT: @RuntimeCallTooMany.%c: i32 = bind_name c, %c.loc57_39.1 +// 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: @RuntimeCallTooMany.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc68_29.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%a: i32 = bind_name a, %a.loc68_29.1 +// 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.loc68_37.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCallBadReturnType.%b: i32 = bind_name b, %b.loc68_37.1 -// CHECK:STDOUT: %bool.make_type.loc68: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type.loc68 [template = bool] -// CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type.loc68, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: @RuntimeCallBadReturnType.%return: ref bool = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -491,31 +512,36 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // 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: } { // 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.loc4_11.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc4_11.1 +// 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: @Negate.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc5_8.1 +// 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.loc5_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc5_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 24cd9deb8f8c..2d333cbf4571 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -71,20 +71,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -103,20 +106,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -184,20 +190,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc4_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc4_8.1 +// 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.loc4_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Sub.%b: i32 = bind_name b, %b.loc4_16.1 +// 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: @Sub.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index f666d79eb37a..1f271898a7fd 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -61,20 +61,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc2_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Xor.%a: i32 = bind_name a, %a.loc2_8.1 +// 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.loc2_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Xor.%b: i32 = bind_name b, %b.loc2_16.1 +// 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: @Xor.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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] @@ -93,20 +96,23 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // 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: %b.patt: i32 = binding_pattern b +// 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.loc7_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @RuntimeCall.%a: i32 = bind_name a, %a.loc7_16.1 +// 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.loc7_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @RuntimeCall.%b: i32 = bind_name b, %b.loc7_24.1 +// 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: @RuntimeCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index ba535edbec34..309c73130c3e 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+45, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref Core//prelude, inst+46, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -57,13 +57,15 @@ fn Main() { // CHECK:STDOUT: } // 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: } { // 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.loc11_10.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Print.1.%a: i32 = bind_name a, %a.loc11_10.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 23285ee6fb8d..b209875ee0db 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -189,8 +189,8 @@ class A { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { @@ -203,15 +203,15 @@ class A { // CHECK:STDOUT: %.loc6_39.2: type = converted %int.make_type_32.loc6, %.loc6_39.1 [template = i32] // CHECK:STDOUT: %.loc6_45: i32 = int_literal 5 [template = constants.%.3] // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT: i32 = bind_name SOME_INTERNAL_CONSTANT, %.loc6_45 -// CHECK:STDOUT: %SomeInternalFunction.decl: %SomeInternalFunction.type = fn_decl @SomeInternalFunction [template = constants.%SomeInternalFunction] { -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_40.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_40.2: type = converted %int.make_type_32.loc8, %.loc8_40.1 [template = i32] -// CHECK:STDOUT: %return.var.loc8: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc8_40.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc8_40.2: type = converted %int.make_type_32, %.loc8_40.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %return.var.loc12: ref %Circle = var +// CHECK:STDOUT: %return: ref %Circle = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -231,15 +231,15 @@ class A { // CHECK:STDOUT: return %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make() -> @Circle.%return.var.loc12: %Circle { +// CHECK:STDOUT: fn @Make() -> %return: %Circle { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc13_23: i32 = int_literal 5 [template = constants.%.3] // CHECK:STDOUT: %.loc13_24.1: %.4 = struct_literal (%.loc13_23) -// CHECK:STDOUT: %.loc13_24.2: ref i32 = class_element_access @Circle.%return.var.loc12, element0 +// CHECK:STDOUT: %.loc13_24.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc13_24.3: init i32 = initialize_from %.loc13_23 to %.loc13_24.2 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_24.4: init %Circle = class_init (%.loc13_24.3), @Circle.%return.var.loc12 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_24.4: init %Circle = class_init (%.loc13_24.3), %return [template = constants.%struct] // CHECK:STDOUT: %.loc13_25: init %Circle = converted %.loc13_24.1, %.loc13_24.4 [template = constants.%struct] -// CHECK:STDOUT: return %.loc13_25 to @Circle.%return.var.loc12 +// CHECK:STDOUT: return %.loc13_25 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -306,8 +306,8 @@ class A { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -376,37 +376,41 @@ class A { // CHECK:STDOUT: .Circle = %Circle.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} +// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5, %.loc5_23.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32, %.loc5_23.1 [template = i32] // 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.ref.loc7: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.loc7_16.1: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_16.2: %Circle = bind_name self, %self.loc7_16.1 -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_33.2: type = converted %int.make_type_32.loc7, %.loc7_33.1 [template = i32] -// CHECK:STDOUT: %return.var.loc7: ref i32 = var +// CHECK:STDOUT: %self.patt: %Circle = binding_pattern self +// 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: } -// CHECK:STDOUT: %SomeInternalFunction.decl: %SomeInternalFunction.type = fn_decl @SomeInternalFunction [template = constants.%SomeInternalFunction] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_40.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_40.2: type = converted %int.make_type_32.loc11, %.loc11_40.1 [template = i32] -// CHECK:STDOUT: %return.var.loc11: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc11_40.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_40.2: type = converted %int.make_type_32, %.loc11_40.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Compute.decl: %Compute.type = fn_decl @Compute [template = constants.%Compute] { -// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.loc15_14.1: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self.loc15_14.2: %Circle = bind_name self, %self.loc15_14.1 -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_31.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_31.2: type = converted %int.make_type_32.loc15, %.loc15_31.1 [template = i32] -// CHECK:STDOUT: %return.var.loc15: ref i32 = var +// CHECK:STDOUT: %self.patt: %Circle = binding_pattern self +// 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: } // CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -420,9 +424,9 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetRadius[@Circle.%self.loc7_16.2: %Circle]() -> i32 { +// CHECK:STDOUT: fn @GetRadius[%self: %Circle]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Circle = name_ref self, @Circle.%self.loc7_16.2 +// CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self // CHECK:STDOUT: %radius.ref: %.2 = name_ref radius, @Circle.%.loc5_21 [template = @Circle.%.loc5_21] // CHECK:STDOUT: %.loc8_16.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc8_16.2: i32 = bind_value %.loc8_16.1 @@ -435,9 +439,9 @@ class A { // CHECK:STDOUT: return %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Compute[@Circle.%self.loc15_14.2: %Circle]() -> i32 { +// CHECK:STDOUT: fn @Compute[%self: %Circle]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Circle = name_ref self, @Circle.%self.loc15_14.2 +// CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self // CHECK:STDOUT: %SomeInternalFunction.ref: %SomeInternalFunction.type = name_ref SomeInternalFunction, @Circle.%SomeInternalFunction.decl [template = constants.%SomeInternalFunction] // CHECK:STDOUT: %SomeInternalFunction.call: init i32 = call %SomeInternalFunction.ref() // CHECK:STDOUT: %.loc16_39.1: i32 = value_of_initializer %SomeInternalFunction.call @@ -480,7 +484,7 @@ class A { // CHECK:STDOUT: .x = @__global_init.%x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32, %.loc8_8.1 [template = i32] @@ -545,7 +549,7 @@ class A { // CHECK:STDOUT: .y = @__global_init.%y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] // CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] @@ -619,12 +623,12 @@ class A { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index ac11debbec06..d057b53f3928 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -84,9 +84,9 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: .StructAdapter = %StructAdapter.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} -// CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} +// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {} +// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {} +// CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { @@ -169,17 +169,19 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Adapted.decl: type = class_decl @Adapted [template = constants.%Adapted] {} -// CHECK:STDOUT: %AdaptNotExtend.decl: type = class_decl @AdaptNotExtend [template = constants.%AdaptNotExtend] {} +// CHECK:STDOUT: %Adapted.decl: type = class_decl @Adapted [template = constants.%Adapted] {} {} +// 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: %AdaptNotExtend.ref: type = name_ref AdaptNotExtend, %AdaptNotExtend.decl [template = constants.%AdaptNotExtend] -// CHECK:STDOUT: %a.loc12_6.1: %AdaptNotExtend = param a, runtime_param0 -// CHECK:STDOUT: @F.2.%a: %AdaptNotExtend = bind_name a, %a.loc12_6.1 +// CHECK:STDOUT: %a.patt: %AdaptNotExtend = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Adapted { -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 369f8670c5ef..d48039438693 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -83,16 +83,18 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: .Access = %Access.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %Derived.ref.loc21: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: @Make.%return: ref %Derived = var +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %return: ref %Derived = var // CHECK:STDOUT: } // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { -// CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.loc25_11.1: %Derived = param d, runtime_param0 -// CHECK:STDOUT: @Access.%d: %Derived = bind_name d, %d.loc25_11.1 +// CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// 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) @@ -101,7 +103,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.loc25_35.4: type = value_of_initializer %int.make_type_32.loc25_32 [template = 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: @Access.%return: ref %.17 = var +// CHECK:STDOUT: %return: ref %.17 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 94a2bee3d5ef..e4e82b79c2f5 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -73,18 +73,20 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: .Access = %Access.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// 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: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// 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.loc24_11.1: %.10 = param p, runtime_param0 -// CHECK:STDOUT: @Access.%p: %.10 = bind_name p, %p.loc24_11.1 +// 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: @Access.%return: ref %.11 = var +// CHECK:STDOUT: %return: ref %.11 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_function_unqualified.carbon b/toolchain/check/testdata/class/base_function_unqualified.carbon index b0f5a3680a1e..d2c8916c8218 100644 --- a/toolchain/check/testdata/class/base_function_unqualified.carbon +++ b/toolchain/check/testdata/class/base_function_unqualified.carbon @@ -63,13 +63,13 @@ fn Derived.H() { // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -80,8 +80,8 @@ fn Derived.H() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: %.loc20: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index a00ca01a59d2..84251121dc5d 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -75,20 +75,24 @@ fn Call(p: Derived*) { // CHECK:STDOUT: .Call = %Call.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} +// 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.ref: type = name_ref Self, constants.%Base [template = constants.%Base] +// CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// 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.loc17_16.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %.3 = bind_name self, %self.loc17_16.1 -// CHECK:STDOUT: @F.%.loc17: %.3 = addr_pattern @F.%self +// 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: } -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} +// 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: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// 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.loc25_9.1: %.11 = param p, runtime_param0 -// CHECK:STDOUT: @Call.%p: %.11 = bind_name p, %p.loc25_9.1 +// CHECK:STDOUT: %p.param: %.11 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -98,11 +102,13 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // 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.ref: type = name_ref Self, constants.%Base [template = constants.%Base] +// CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// 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.loc14_13.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_13.3: %.3 = bind_name self, %self.loc14_13.1 -// CHECK:STDOUT: %.loc14_8: %.3 = addr_pattern %self.loc14_13.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: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -125,9 +131,9 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self: %.3]() { +// CHECK:STDOUT: fn @F[addr %self.loc17: %.3]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.3 = name_ref self, %self +// CHECK:STDOUT: %self.ref: %.3 = name_ref self, %self.loc17 // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // CHECK:STDOUT: %.loc18_10: ref i32 = class_element_access %.loc18_4, element0 diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 8f99beb95e6f..bad9bb5d4bd0 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -99,46 +99,54 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: .PassDerivedToBaseIndirect = %PassDerivedToBaseIndirect.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Derived.decl.loc11: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl.loc18: type = class_decl @Derived [template = constants.%Derived] {} +// CHECK:STDOUT: %Derived.decl.loc11: type = class_decl @Derived [template = constants.%Derived] {} {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// 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: %Derived.ref.loc25: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %a.loc25_9.1: %Derived = param a, runtime_param0 -// CHECK:STDOUT: @Call.%a: %Derived = bind_name a, %a.loc25_9.1 -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_24.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_24.2: type = converted %int.make_type_32.loc25, %.loc25_24.1 [template = i32] -// CHECK:STDOUT: @Call.%return: ref i32 = var +// CHECK:STDOUT: %a.patt: %Derived = binding_pattern a +// 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: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [template = constants.%CallIndirect] { -// CHECK:STDOUT: %Derived.ref.loc29: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// 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.loc29_17.1: %.10 = param p, runtime_param0 -// CHECK:STDOUT: @CallIndirect.%p: %.10 = bind_name p, %p.loc29_17.1 -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_33.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_32.loc29, %.loc29_33.1 [template = i32] -// CHECK:STDOUT: @CallIndirect.%return: ref i32 = var +// 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: } // CHECK:STDOUT: %PassDerivedToBase.decl: %PassDerivedToBase.type = fn_decl @PassDerivedToBase [template = constants.%PassDerivedToBase] { -// CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %a.loc33_22.1: %Derived = param a, runtime_param0 -// CHECK:STDOUT: @PassDerivedToBase.%a: %Derived = bind_name a, %a.loc33_22.1 -// CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_37.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] -// CHECK:STDOUT: %.loc33_37.2: type = converted %int.make_type_32.loc33, %.loc33_37.1 [template = i32] -// CHECK:STDOUT: @PassDerivedToBase.%return: ref i32 = var +// CHECK:STDOUT: %a.patt: %Derived = binding_pattern a +// 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: } // CHECK:STDOUT: %PassDerivedToBaseIndirect.decl: %PassDerivedToBaseIndirect.type = fn_decl @PassDerivedToBaseIndirect [template = constants.%PassDerivedToBaseIndirect] { -// CHECK:STDOUT: %Derived.ref.loc37: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// 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.loc37_30.1: %.10 = param p, runtime_param0 -// CHECK:STDOUT: @PassDerivedToBaseIndirect.%p: %.10 = bind_name p, %p.loc37_30.1 -// CHECK:STDOUT: %int.make_type_32.loc37: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc37_46.1: type = value_of_initializer %int.make_type_32.loc37 [template = i32] -// CHECK:STDOUT: %.loc37_46.2: type = converted %int.make_type_32.loc37, %.loc37_46.1 [template = i32] -// CHECK:STDOUT: @PassDerivedToBaseIndirect.%return: ref i32 = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -146,14 +154,18 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // 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.ref.loc21: type = name_ref Self, constants.%Derived [template = constants.%Derived] -// CHECK:STDOUT: %self.loc21_8.1: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self.loc21_8.2: %Derived = bind_name self, %self.loc21_8.1 +// CHECK:STDOUT: %self.patt: %Derived = binding_pattern self +// 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: } // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { -// CHECK:STDOUT: %Self.ref.loc22: type = name_ref Self, constants.%Derived [template = constants.%Derived] -// CHECK:STDOUT: %self.loc22_8.1: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self.loc22_8.2: %Derived = bind_name self, %self.loc22_8.1 +// CHECK:STDOUT: %self.patt: %Derived = binding_pattern self +// 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: } // CHECK:STDOUT: %.loc23: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: @@ -167,22 +179,26 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.loc14_8.1: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_8.2: %Base = bind_name self, %self.loc14_8.1 -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32.loc14, %.loc14_25.1 [template = i32] -// CHECK:STDOUT: %return.var.loc14: ref i32 = var +// 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: } // 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: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %self.loc15_8.1: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self.loc15_8.2: %Derived = bind_name self, %self.loc15_8.1 -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_28.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_28.2: type = converted %int.make_type_32.loc15, %.loc15_28.1 [template = i32] -// CHECK:STDOUT: %return.var.loc15: ref i32 = var +// 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: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -194,13 +210,13 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[@Base.%self.loc14_8.2: %Base]() -> i32; +// CHECK:STDOUT: fn @F.1[%self: %Base]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.1[@Base.%self.loc15_8.2: %Derived]() -> i32; +// CHECK:STDOUT: fn @G.1[%self: %Derived]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[@Derived.%self.loc21_8.2: %Derived](); +// CHECK:STDOUT: fn @F.2[%self: %Derived](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[@Derived.%self.loc22_8.2: %Derived](); +// CHECK:STDOUT: fn @G.2[%self: %Derived](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Call(%a: %Derived) -> i32 { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index ac9636ac26e6..2dcda479efe3 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -92,37 +92,44 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: .Call = %Call.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// 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.ref: type = name_ref A, %A.decl [template = constants.%A] +// CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// CHECK:STDOUT: %b.patt: %.7 = binding_pattern b +// CHECK:STDOUT: %c.patt: %.13 = binding_pattern c +// CHECK:STDOUT: %d.patt: %.17 = binding_pattern d +// 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.loc29_9.1: %.1 = param a, runtime_param0 -// CHECK:STDOUT: @Call.%a: %.1 = bind_name a, %a.loc29_9.1 -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] +// 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.loc29_16.1: %.7 = param b, runtime_param1 -// CHECK:STDOUT: @Call.%b: %.7 = bind_name b, %b.loc29_16.1 -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// 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.loc29_23.1: %.13 = param c, runtime_param2 -// CHECK:STDOUT: @Call.%c: %.13 = bind_name c, %c.loc29_23.1 -// CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] +// 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.loc29_30.1: %.17 = param d, runtime_param3 -// CHECK:STDOUT: @Call.%d: %.17 = bind_name d, %d.loc29_30.1 +// CHECK:STDOUT: %d.param: %.17 = param d, runtime_param3 +// CHECK:STDOUT: %d: %.17 = bind_name d, %d.param // 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: } { // 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.loc12_13.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 +// 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: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -135,11 +142,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // 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: } { // 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.loc17_13.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17_13.3: %.7 = bind_name self, %self.loc17_13.1 -// CHECK:STDOUT: %.loc17_8: %.7 = addr_pattern %self.loc17_13.3 +// 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: } // CHECK:STDOUT: %.loc18: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: @@ -154,11 +163,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // 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: } { // 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.loc22_13.1: %.13 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc22_13.3: %.13 = bind_name self, %self.loc22_13.1 -// CHECK:STDOUT: %.loc22_8: %.13 = addr_pattern %self.loc22_13.3 +// 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: } // CHECK:STDOUT: %.loc23: = complete_type_witness %.14 [template = constants.%.15] // CHECK:STDOUT: @@ -180,11 +191,11 @@ 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 @A.%self.loc12_13.3: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[addr @B.%self.loc17_13.3: %.7](); +// CHECK:STDOUT: fn @F.2[addr %self: %.7](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[addr @C.%self.loc22_13.3: %.13](); +// CHECK:STDOUT: fn @F.3[addr %self: %.13](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Call(%a: %.1, %b: %.7, %c: %.13, %d: %.17) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 89abbbb1aee8..97ad4fe8c144 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -68,52 +68,58 @@ fn Run() -> i32 { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: } { // 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.loc21_12.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @G.%n: i32 = bind_name n, %n.loc21_12.1 +// 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: @G.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_13.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_13.2: type = converted %int.make_type_32.loc25, %.loc25_13.1 [template = i32] -// CHECK:STDOUT: @Run.%return: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc25_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc25_13.2: type = converted %int.make_type_32, %.loc25_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // 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: } { // 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.loc12_8.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc12_8.2: i32 = bind_name n, %n.loc12_8.1 +// 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.var.loc12: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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.loc16_8.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc16_8.2: i32 = bind_name n, %n.loc16_8.1 +// 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: } -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32.loc18, %.loc18_10.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32, %.loc18_10.1 [template = i32] // CHECK:STDOUT: %.loc18_8: %.2 = field_decl k, element0 [template] // CHECK:STDOUT: %.loc19: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -126,15 +132,15 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(@Class.%n.loc12_8.2: i32) -> i32 { +// CHECK:STDOUT: fn @F(%n: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, @Class.%n.loc12_8.2 +// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n: i32) -> i32 { +// CHECK:STDOUT: fn @G(%n.loc21: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 3cac1c2df1e6..a4cace469247 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -50,22 +50,24 @@ class C { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // 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: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.loc12_8.1: %C = param c, runtime_param0 -// CHECK:STDOUT: %c.loc12_8.2: %C = bind_name c, %c.loc12_8.1 -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32.loc12, %.loc12_17.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// 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: } -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.2 = field_decl a, element0 [template] // CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -77,9 +79,9 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(@C.%c.loc12_8.2: %C) -> i32 { +// CHECK:STDOUT: fn @F(%c: %C) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: %C = name_ref c, @C.%c.loc12_8.2 +// CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @C.%.loc14_8 [template = @C.%.loc14_8] // CHECK:STDOUT: %.loc12_31.1: ref i32 = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc12_31.2: i32 = bind_value %.loc12_31.1 diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index ed0073d086c9..4613c614d1b9 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -94,47 +94,55 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: .AccessBaseIndirect = %AccessBaseIndirect.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// 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: %Derived.ref.loc24: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.loc24_18.1: %Derived = param d, runtime_param0 -// CHECK:STDOUT: @AccessDerived.%d: %Derived = bind_name d, %d.loc24_18.1 -// CHECK:STDOUT: %int.make_type_32.loc24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_33.1: type = value_of_initializer %int.make_type_32.loc24 [template = i32] -// CHECK:STDOUT: %.loc24_33.2: type = converted %int.make_type_32.loc24, %.loc24_33.1 [template = i32] -// CHECK:STDOUT: @AccessDerived.%return: ref i32 = var +// CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// 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: } // CHECK:STDOUT: %AccessBase.decl: %AccessBase.type = fn_decl @AccessBase [template = constants.%AccessBase] { -// CHECK:STDOUT: %Derived.ref.loc28: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.loc28_15.1: %Derived = param d, runtime_param0 -// CHECK:STDOUT: @AccessBase.%d: %Derived = bind_name d, %d.loc28_15.1 -// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_30.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] -// CHECK:STDOUT: %.loc28_30.2: type = converted %int.make_type_32.loc28, %.loc28_30.1 [template = i32] -// CHECK:STDOUT: @AccessBase.%return: ref i32 = var +// CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// 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: } // CHECK:STDOUT: %AccessDerivedIndirect.decl: %AccessDerivedIndirect.type = fn_decl @AccessDerivedIndirect [template = constants.%AccessDerivedIndirect] { -// CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, %Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// 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.loc32_26.1: %.13 = param p, runtime_param0 -// CHECK:STDOUT: @AccessDerivedIndirect.%p: %.13 = bind_name p, %p.loc32_26.1 -// CHECK:STDOUT: %int.make_type_32.loc32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_32.loc32 [template = i32] -// CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_32.loc32, %.loc32_45.1 [template = i32] +// 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: @AccessDerivedIndirect.%return: ref %.14 = var +// CHECK:STDOUT: %return: ref %.14 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBaseIndirect.decl: %AccessBaseIndirect.type = fn_decl @AccessBaseIndirect [template = constants.%AccessBaseIndirect] { -// CHECK:STDOUT: %Derived.ref.loc36: type = name_ref Derived, %Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// 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.loc36_23.1: %.13 = param p, runtime_param0 -// CHECK:STDOUT: @AccessBaseIndirect.%p: %.13 = bind_name p, %p.loc36_23.1 -// CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] -// CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_32.loc36, %.loc36_42.1 [template = i32] +// 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: @AccessBaseIndirect.%return: ref %.14 = var +// CHECK:STDOUT: %return: ref %.14 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -186,7 +194,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: fn @AccessDerived(%d: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc25_10: %Derived = name_ref d, %d -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.ref.loc25_20: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] // CHECK:STDOUT: %.loc25_11.1: ref i32 = class_element_access %d.ref.loc25_10, element1 // CHECK:STDOUT: %.loc25_11.2: i32 = bind_value %.loc25_11.1 @@ -208,7 +216,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: fn @AccessDerivedIndirect(%p: %.13) -> %.14 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.ref: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] // CHECK:STDOUT: %.loc33_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc33_12.2: ref i32 = class_element_access %.loc33_12.1, element1 diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 8e98d482135f..a76979ad86a9 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -126,7 +126,7 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -161,7 +161,7 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -193,7 +193,7 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C() { diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 703a9501b15a..98d90598b306 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -119,51 +119,61 @@ fn ConvertInit() { // CHECK:STDOUT: .ConvertInit = %ConvertInit.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// 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: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// 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.loc25_16.1: %.17 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertCToB.%p: %.17 = bind_name p, %p.loc25_16.1 -// CHECK:STDOUT: %B.ref.loc25: type = name_ref B, %B.decl [template = constants.%B] +// 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: @ConvertCToB.%return: ref %.18 = var +// CHECK:STDOUT: %return: ref %.18 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertBToA.decl: %ConvertBToA.type = fn_decl @ConvertBToA [template = constants.%ConvertBToA] { -// CHECK:STDOUT: %B.ref.loc26: type = name_ref B, %B.decl [template = constants.%B] +// CHECK:STDOUT: %p.patt: %.18 = binding_pattern p +// 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.loc26_16.1: %.18 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertBToA.%p: %.18 = bind_name p, %p.loc26_16.1 -// CHECK:STDOUT: %A.ref.loc26: type = name_ref A, %A.decl [template = constants.%A] +// 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: @ConvertBToA.%return: ref %.22 = var +// CHECK:STDOUT: %return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertCToA.decl: %ConvertCToA.type = fn_decl @ConvertCToA [template = constants.%ConvertCToA] { -// CHECK:STDOUT: %C.ref.loc27: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// 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.loc27_16.1: %.17 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertCToA.%p: %.17 = bind_name p, %p.loc27_16.1 -// CHECK:STDOUT: %A.ref.loc27: type = name_ref A, %A.decl [template = constants.%A] +// 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: @ConvertCToA.%return: ref %.22 = var +// CHECK:STDOUT: %return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertValue.decl: %ConvertValue.type = fn_decl @ConvertValue [template = constants.%ConvertValue] { -// CHECK:STDOUT: %C.ref.loc29: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %c.loc29_17.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @ConvertValue.%c: %C = bind_name c, %c.loc29_17.1 +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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: } // CHECK:STDOUT: %ConvertRef.decl: %ConvertRef.type = fn_decl @ConvertRef [template = constants.%ConvertRef] { -// CHECK:STDOUT: %C.ref.loc33: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %c.patt: %.17 = binding_pattern c +// 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.loc33_15.1: %.17 = param c, runtime_param0 -// CHECK:STDOUT: @ConvertRef.%c: %.17 = bind_name c, %c.loc33_15.1 -// CHECK:STDOUT: %A.ref.loc33: type = name_ref A, %A.decl [template = constants.%A] +// 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: @ConvertRef.%return: ref %.22 = var +// CHECK:STDOUT: %return: ref %.22 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [template = constants.%ConvertInit] {} +// CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [template = constants.%ConvertInit] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -259,7 +269,7 @@ fn ConvertInit() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %.17 = name_ref c, %c // CHECK:STDOUT: %.loc34_12: ref %C = deref %c.ref -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc34: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc34_15.1: ref %B = class_element_access %.loc34_12, element0 // CHECK:STDOUT: %.loc34_15.2: ref %A = class_element_access %.loc34_15.1, element0 // CHECK:STDOUT: %.loc34_15.3: ref %A = converted %.loc34_12, %.loc34_15.2 diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index c31cd0497136..580eb8d7b097 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -143,18 +143,22 @@ class StructAdapter { // CHECK:STDOUT: .TestAdapterMethod = %TestAdapterMethod.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} -// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// CHECK:STDOUT: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} +// CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {} +// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {} +// 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: %SomeClassAdapter.ref.loc19: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.loc19_29.1: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: @TestStaticMemberFunction.%a: %SomeClassAdapter = bind_name a, %a.loc19_29.1 +// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// 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: } // CHECK:STDOUT: %TestAdapterMethod.decl: %TestAdapterMethod.type = fn_decl @TestAdapterMethod [template = constants.%TestAdapterMethod] { -// CHECK:STDOUT: %SomeClassAdapter.ref.loc23: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.loc23_22.1: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: @TestAdapterMethod.%a: %SomeClassAdapter = bind_name a, %a.loc23_22.1 +// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -177,11 +181,13 @@ class StructAdapter { // CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32.loc8, %.loc8_10.1 [template = i32] // CHECK:STDOUT: %.loc8_8: %.2 = field_decl b, element1 [template] -// CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} +// 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: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %self.loc12_20.1: %SomeClassAdapter = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_20.2: %SomeClassAdapter = bind_name self, %self.loc12_20.1 +// CHECK:STDOUT: %self.param: %SomeClassAdapter = param self, runtime_param0 +// CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -197,7 +203,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: fn @StaticMemberFunction(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @AdapterMethod[@SomeClass.%self.loc12_20.2: %SomeClassAdapter](); +// CHECK:STDOUT: fn @AdapterMethod[%self: %SomeClassAdapter](); // CHECK:STDOUT: // CHECK:STDOUT: fn @TestStaticMemberFunction(%a: %SomeClassAdapter) { // CHECK:STDOUT: !entry: @@ -260,12 +266,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] +// 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 { @@ -276,12 +282,14 @@ class StructAdapter { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} +// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {} +// 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: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.loc12_6.1: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: @F.2.%a: %SomeClassAdapter = bind_name a, %a.loc12_6.1 +// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -306,9 +314,11 @@ class StructAdapter { // CHECK:STDOUT: // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass] -// CHECK:STDOUT: %self.loc5_8.1: %SomeClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc5_8.2: %SomeClass = bind_name self, %self.loc5_8.1 +// CHECK:STDOUT: %self.param: %SomeClass = param self, runtime_param0 +// CHECK:STDOUT: %self: %SomeClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -327,7 +337,7 @@ class StructAdapter { // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[@SomeClass.%self.loc5_8.2: %SomeClass](); +// CHECK:STDOUT: fn @F.1[%self: %SomeClass](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%a: %SomeClassAdapter) { // CHECK:STDOUT: !entry: @@ -427,12 +437,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -443,16 +453,18 @@ class StructAdapter { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} +// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {} +// 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: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.loc13_6.1: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: %SomeClassAdapter = bind_name a, %a.loc13_6.1 +// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -587,7 +599,7 @@ class StructAdapter { // CHECK:STDOUT: .StructAdapter = %StructAdapter.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} +// CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 0d7a5557d6b9..75c5d4322b79 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -85,16 +85,18 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: .Access = %Access.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %Derived.ref.loc21: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: @Make.%return: ref %Derived = var +// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {} +// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %return: ref %Derived = var // CHECK:STDOUT: } // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { -// CHECK:STDOUT: %Derived.ref.loc29: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.loc29_11.1: %Derived = param d, runtime_param0 -// CHECK:STDOUT: @Access.%d: %Derived = bind_name d, %d.loc29_11.1 +// CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// 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.loc29_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc29_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_35.1: %.16 = tuple_literal (%int.make_type_32.loc29_27, %int.make_type_32.loc29_32) @@ -103,7 +105,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.loc29_35.4: type = value_of_initializer %int.make_type_32.loc29_32 [template = i32] // CHECK:STDOUT: %.loc29_35.5: type = converted %int.make_type_32.loc29_32, %.loc29_35.4 [template = i32] // CHECK:STDOUT: %.loc29_35.6: type = converted %.loc29_35.1, constants.%.17 [template = constants.%.17] -// CHECK:STDOUT: @Access.%return: ref %.17 = var +// CHECK:STDOUT: %return: ref %.17 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 11b50b523ec9..2efb3b03b792 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -140,12 +140,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -155,11 +155,13 @@ class C { // CHECK:STDOUT: .Use = %Use.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} +// 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: %Bad.ref: type = name_ref Bad, %Bad.decl [template = constants.%Bad] -// CHECK:STDOUT: %b.loc19_8.1: %Bad = param b, runtime_param0 -// CHECK:STDOUT: @Use.%b: %Bad = bind_name b, %b.loc19_8.1 +// CHECK:STDOUT: %b.patt: %Bad = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -278,12 +280,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -293,11 +295,13 @@ class C { // CHECK:STDOUT: .Use = %Use.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} +// 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: %Bad.ref: type = name_ref Bad, %Bad.decl [template = constants.%Bad] -// CHECK:STDOUT: %b.loc16_8.1: %Bad = param b, runtime_param0 -// CHECK:STDOUT: @Use.%b: %Bad = bind_name b, %b.loc16_8.1 +// CHECK:STDOUT: %b.patt: %Bad = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -409,8 +413,8 @@ class C { // CHECK:STDOUT: .MultipleAdaptsSameType = %MultipleAdaptsSameType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %MultipleAdapts.decl: type = class_decl @MultipleAdapts [template = constants.%MultipleAdapts] {} -// CHECK:STDOUT: %MultipleAdaptsSameType.decl: type = class_decl @MultipleAdaptsSameType [template = constants.%MultipleAdaptsSameType] {} +// CHECK:STDOUT: %MultipleAdapts.decl: type = class_decl @MultipleAdapts [template = constants.%MultipleAdapts] {} {} +// CHECK:STDOUT: %MultipleAdaptsSameType.decl: type = class_decl @MultipleAdaptsSameType [template = constants.%MultipleAdaptsSameType] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @MultipleAdapts { @@ -468,8 +472,8 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc8: %.1 = struct_literal () -// CHECK:STDOUT: %I.decl: type = interface_decl @I.1 [template = constants.%.2] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I.1 [template = constants.%.2] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I.1 { @@ -491,7 +495,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %I.decl: type = interface_decl @I.2 [template = constants.%.3] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I.2 [template = constants.%.3] {} {} // CHECK:STDOUT: %.loc25: = complete_type_witness %.1 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 8cff588d39f1..3889d4bd075c 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -51,8 +51,8 @@ class AdaptIncomplete { // CHECK:STDOUT: .AdaptIncomplete = %AdaptIncomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} -// CHECK:STDOUT: %AdaptIncomplete.decl: type = class_decl @AdaptIncomplete [template = constants.%AdaptIncomplete] {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} +// CHECK:STDOUT: %AdaptIncomplete.decl: type = class_decl @AdaptIncomplete [template = constants.%AdaptIncomplete] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index f8387bce5f56..0871c4f8e35e 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -95,12 +95,12 @@ class C5 { // CHECK:STDOUT: .C5 = %C5.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} -// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} -// CHECK:STDOUT: %C3.decl: type = class_decl @C3 [template = constants.%C3] {} -// CHECK:STDOUT: %C4.decl: type = class_decl @C4 [template = constants.%C4] {} -// CHECK:STDOUT: %C5.decl: type = class_decl @C5 [template = constants.%C5] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} {} +// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {} +// CHECK:STDOUT: %C3.decl: type = class_decl @C3 [template = constants.%C3] {} {} +// CHECK:STDOUT: %C4.decl: type = class_decl @C4 [template = constants.%C4] {} {} +// CHECK:STDOUT: %C5.decl: type = class_decl @C5 [template = constants.%C5] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 0e1782add643..c2425af5c397 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -110,8 +110,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: .AdaptWithBase = %AdaptWithBase.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %AdaptWithBase.decl: type = class_decl @AdaptWithBase [template = constants.%AdaptWithBase] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %AdaptWithBase.decl: type = class_decl @AdaptWithBase [template = constants.%AdaptWithBase] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { @@ -171,8 +171,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: .AdaptWithFields = %AdaptWithFields.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %AdaptWithField.decl: type = class_decl @AdaptWithField [template = constants.%AdaptWithField] {} -// CHECK:STDOUT: %AdaptWithFields.decl: type = class_decl @AdaptWithFields [template = constants.%AdaptWithFields] {} +// CHECK:STDOUT: %AdaptWithField.decl: type = class_decl @AdaptWithField [template = constants.%AdaptWithField] {} {} +// CHECK:STDOUT: %AdaptWithFields.decl: type = class_decl @AdaptWithFields [template = constants.%AdaptWithFields] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithField { @@ -254,8 +254,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: .AdaptWithBaseAndFields = %AdaptWithBaseAndFields.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %AdaptWithBaseAndFields.decl: type = class_decl @AdaptWithBaseAndFields [template = constants.%AdaptWithBaseAndFields] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %AdaptWithBaseAndFields.decl: type = class_decl @AdaptWithBaseAndFields [template = constants.%AdaptWithBaseAndFields] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index c2b1fdfd504b..59c502c6df84 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -54,21 +54,25 @@ class Class { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// 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.loc16_13.1: %.1 = param a, runtime_param0 -// CHECK:STDOUT: %a.loc16_13.2: %.1 = bind_name a, %a.loc16_13.1 +// CHECK:STDOUT: %a.param: %.1 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.1 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Class.ref.loc21: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %b.patt: %.1 = binding_pattern b +// 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.loc21_13.1: %.1 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc21_13.2: %.1 = bind_name b, %b.loc21_13.1 +// CHECK:STDOUT: %b.param: %.1 = param b, runtime_param0 +// CHECK:STDOUT: %b: %.1 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -78,7 +82,7 @@ class Class { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[@Class.%a.loc16_13.2: %.1](); +// CHECK:STDOUT: fn @F[%a: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(@Class.%b.loc21_13.2: %.1); +// CHECK:STDOUT: fn @G(%b: %.1); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 828038b1e1c7..1ae04988492c 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -92,12 +92,12 @@ 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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] +// 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 { @@ -107,15 +107,18 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%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: %Class.ref.loc16_9: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc16_6.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @F.2.%c: %Class = bind_name c, %c.loc16_6.1 -// CHECK:STDOUT: %Class.ref.loc16_19: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// 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.loc16_16.1: %.1 = param p, runtime_param1 -// CHECK:STDOUT: @F.2.%p: %.1 = bind_name p, %p.loc16_16.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: @@ -140,17 +143,21 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { -// CHECK:STDOUT: %Class.ref.loc12: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// 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.loc12_13.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 +// 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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Class.ref.loc13: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.loc13_13.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_13.3: %Class = bind_name self, %self.loc13_13.1 -// CHECK:STDOUT: %.loc13: %Class = addr_pattern %self.loc13_13.3 +// CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// 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: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -160,9 +167,9 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[addr @Class.%self.loc12_13.3: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr @Class.%self.loc13_13.3: %Class](); +// CHECK:STDOUT: fn @G[addr %self: %Class](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%c: %Class, %p: %.1) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 1a6515328c9e..b02667158a1c 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -270,12 +270,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -306,80 +306,94 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: .AccessMemberWithInvalidBaseFinal_NoMember = %AccessMemberWithInvalidBaseFinal_NoMember.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Final.decl: type = class_decl @Final [template = constants.%Final] {} -// CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %Final.decl: type = class_decl @Final [template = constants.%Final] {} {} +// 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: %DeriveFromError.ref: type = name_ref DeriveFromError, %DeriveFromError.decl [template = constants.%DeriveFromError] +// CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] // CHECK:STDOUT: %.loc25_55: type = ptr_type %DeriveFromError [template = constants.%.7] -// CHECK:STDOUT: %p.loc25_37.1: %.7 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseError.%p: %.7 = bind_name p, %p.loc25_37.1 -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_61.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_61.2: type = converted %int.make_type_32.loc25, %.loc25_61.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseError.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.7 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc25_61.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc25_61.2: type = converted %int.make_type_32, %.loc25_61.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DeriveFromNonType.decl: type = class_decl @DeriveFromNonType [template = constants.%DeriveFromNonType] {} +// 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: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, %DeriveFromNonType.decl [template = constants.%DeriveFromNonType] +// CHECK:STDOUT: %p.patt: %.16 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] // CHECK:STDOUT: %.loc38_58: type = ptr_type %DeriveFromNonType [template = constants.%.16] -// CHECK:STDOUT: %p.loc38_38.1: %.16 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBasNonType.%p: %.16 = bind_name p, %p.loc38_38.1 -// CHECK:STDOUT: %int.make_type_32.loc38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_64.1: type = value_of_initializer %int.make_type_32.loc38 [template = i32] -// CHECK:STDOUT: %.loc38_64.2: type = converted %int.make_type_32.loc38, %.loc38_64.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBasNonType.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.16 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.16 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc38_64.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc38_64.2: type = converted %int.make_type_32, %.loc38_64.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DeriveFromi32.decl: type = class_decl @DeriveFromi32 [template = constants.%DeriveFromi32] {} +// 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: %DeriveFromi32.ref.loc57: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] +// CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc57_40: type = ptr_type %DeriveFromi32 [template = constants.%.17] -// CHECK:STDOUT: %p.loc57_24.1: %.17 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBasei32.%p: %.17 = bind_name p, %p.loc57_24.1 -// CHECK:STDOUT: %int.make_type_32.loc57: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_49.1: type = value_of_initializer %int.make_type_32.loc57 [template = i32] -// CHECK:STDOUT: %.loc57_49.2: type = converted %int.make_type_32.loc57, %.loc57_49.1 [template = i32] +// CHECK:STDOUT: %p.param: %.17 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc57_49.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc57_49.2: type = converted %int.make_type_32, %.loc57_49.1 [template = i32] // CHECK:STDOUT: %.loc57_49.3: type = ptr_type i32 [template = constants.%.18] -// CHECK:STDOUT: @ConvertToBadBasei32.%return: ref %.18 = var +// CHECK:STDOUT: %return: ref %.18 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.decl: %AccessMemberWithInvalidBasei32.type = fn_decl @AccessMemberWithInvalidBasei32 [template = constants.%AccessMemberWithInvalidBasei32] { -// CHECK:STDOUT: %DeriveFromi32.ref.loc59: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] +// CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc59_51: type = ptr_type %DeriveFromi32 [template = constants.%.17] -// CHECK:STDOUT: %p.loc59_35.1: %.17 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBasei32.%p: %.17 = bind_name p, %p.loc59_35.1 -// CHECK:STDOUT: %int.make_type_32.loc59: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc59_57.1: type = value_of_initializer %int.make_type_32.loc59 [template = i32] -// CHECK:STDOUT: %.loc59_57.2: type = converted %int.make_type_32.loc59, %.loc59_57.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBasei32.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.17 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc59_57.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc59_57.2: type = converted %int.make_type_32, %.loc59_57.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DeriveFromTuple.decl: type = class_decl @DeriveFromTuple [template = constants.%DeriveFromTuple] {} +// 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: %DeriveFromTuple.ref.loc76: type = name_ref DeriveFromTuple, %DeriveFromTuple.decl [template = constants.%DeriveFromTuple] +// CHECK:STDOUT: %p.patt: %.26 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc76_44: type = ptr_type %DeriveFromTuple [template = constants.%.26] -// CHECK:STDOUT: %p.loc76_26.1: %.26 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseTuple.%p: %.26 = bind_name p, %p.loc76_26.1 -// CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] +// CHECK:STDOUT: %p.param: %.26 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.26 = bind_name p, %p.param +// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc76_56: %.22 = tuple_literal (%Base.ref) // CHECK:STDOUT: %.loc76_57.1: type = converted %.loc76_56, constants.%.23 [template = constants.%.23] // CHECK:STDOUT: %.loc76_57.2: type = ptr_type %.23 [template = constants.%.27] -// CHECK:STDOUT: @ConvertToBadBaseTuple.%return: ref %.27 = var +// CHECK:STDOUT: %return: ref %.27 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.decl: %AccessMemberWithInvalidBaseTuple.type = fn_decl @AccessMemberWithInvalidBaseTuple [template = constants.%AccessMemberWithInvalidBaseTuple] { -// CHECK:STDOUT: %DeriveFromTuple.ref.loc78: type = name_ref DeriveFromTuple, %DeriveFromTuple.decl [template = constants.%DeriveFromTuple] +// CHECK:STDOUT: %p.patt: %.26 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc78_55: type = ptr_type %DeriveFromTuple [template = constants.%.26] -// CHECK:STDOUT: %p.loc78_37.1: %.26 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseTuple.%p: %.26 = bind_name p, %p.loc78_37.1 -// CHECK:STDOUT: %int.make_type_32.loc78: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc78_61.1: type = value_of_initializer %int.make_type_32.loc78 [template = i32] -// CHECK:STDOUT: %.loc78_61.2: type = converted %int.make_type_32.loc78, %.loc78_61.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseTuple.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.26 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.26 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc78_61.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc78_61.2: type = converted %int.make_type_32, %.loc78_61.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DeriveFromStruct.decl: type = class_decl @DeriveFromStruct [template = constants.%DeriveFromStruct] {} +// 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: %DeriveFromStruct.ref.loc97: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] +// CHECK:STDOUT: %p.patt: %.33 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc97_46: type = ptr_type %DeriveFromStruct [template = constants.%.33] -// CHECK:STDOUT: %p.loc97_27.1: %.33 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseStruct.%p: %.33 = bind_name p, %p.loc97_27.1 +// CHECK:STDOUT: %p.param: %.33 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.33 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc97_57: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc97_57.1: type = value_of_initializer %int.make_type_32.loc97_57 [template = i32] // CHECK:STDOUT: %.loc97_57.2: type = converted %int.make_type_32.loc97_57, %.loc97_57.1 [template = i32] @@ -388,68 +402,80 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc97_66.2: type = converted %int.make_type_32.loc97_66, %.loc97_66.1 [template = i32] // CHECK:STDOUT: %.loc97_69: type = struct_type {.a: i32, .b: i32} [template = constants.%.31] // CHECK:STDOUT: %.loc97_70: type = ptr_type %.31 [template = constants.%.32] -// CHECK:STDOUT: @ConvertToBadBaseStruct.%return: ref %.32 = var +// CHECK:STDOUT: %return: ref %.32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.decl: %AccessMemberWithInvalidBaseStruct.type = fn_decl @AccessMemberWithInvalidBaseStruct [template = constants.%AccessMemberWithInvalidBaseStruct] { -// CHECK:STDOUT: %DeriveFromStruct.ref.loc100: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] +// CHECK:STDOUT: %p.patt: %.33 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc100_57: type = ptr_type %DeriveFromStruct [template = constants.%.33] -// CHECK:STDOUT: %p.loc100_38.1: %.33 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseStruct.%p: %.33 = bind_name p, %p.loc100_38.1 -// CHECK:STDOUT: %int.make_type_32.loc100: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc100_63.1: type = value_of_initializer %int.make_type_32.loc100 [template = i32] -// CHECK:STDOUT: %.loc100_63.2: type = converted %int.make_type_32.loc100, %.loc100_63.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseStruct.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.33 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.33 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc100_63.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc100_63.2: type = converted %int.make_type_32, %.loc100_63.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} -// CHECK:STDOUT: %DeriveFromIncomplete.decl: type = class_decl @DeriveFromIncomplete [template = constants.%DeriveFromIncomplete] {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} +// 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: %DeriveFromIncomplete.ref.loc122: type = name_ref DeriveFromIncomplete, %DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] +// CHECK:STDOUT: %p.patt: %.37 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc122_54: type = ptr_type %DeriveFromIncomplete [template = constants.%.37] -// CHECK:STDOUT: %p.loc122_31.1: %.37 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%p: %.37 = bind_name p, %p.loc122_31.1 -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] +// CHECK:STDOUT: %p.param: %.37 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.37 = bind_name p, %p.param +// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc122_70: type = ptr_type %Incomplete [template = constants.%.38] -// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%return: ref %.38 = var +// CHECK:STDOUT: %return: ref %.38 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.decl: %AccessMemberWithInvalidBaseIncomplete.type = fn_decl @AccessMemberWithInvalidBaseIncomplete [template = constants.%AccessMemberWithInvalidBaseIncomplete] { -// CHECK:STDOUT: %DeriveFromIncomplete.ref.loc124: type = name_ref DeriveFromIncomplete, %DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] +// CHECK:STDOUT: %p.patt: %.37 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc124_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.37] -// CHECK:STDOUT: %p.loc124_42.1: %.37 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseIncomplete.%p: %.37 = bind_name p, %p.loc124_42.1 -// CHECK:STDOUT: %int.make_type_32.loc124: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc124_71.1: type = value_of_initializer %int.make_type_32.loc124 [template = i32] -// CHECK:STDOUT: %.loc124_71.2: type = converted %int.make_type_32.loc124, %.loc124_71.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseIncomplete.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.37 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.37 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc124_71.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc124_71.2: type = converted %int.make_type_32, %.loc124_71.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DeriveFromFinal.decl: type = class_decl @DeriveFromFinal [template = constants.%DeriveFromFinal] {} +// 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: %DeriveFromFinal.ref.loc135: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %p.patt: %.46 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc135_44: type = ptr_type %DeriveFromFinal [template = constants.%.46] -// CHECK:STDOUT: %p.loc135_26.1: %.46 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseFinal.%p: %.46 = bind_name p, %p.loc135_26.1 -// CHECK:STDOUT: %Final.ref: type = name_ref Final, %Final.decl [template = constants.%Final] +// CHECK:STDOUT: %p.param: %.46 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.46 = bind_name p, %p.param +// CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] // CHECK:STDOUT: %.loc135_55: type = ptr_type %Final [template = constants.%.47] -// CHECK:STDOUT: @ConvertToBadBaseFinal.%return: ref %.47 = var +// CHECK:STDOUT: %return: ref %.47 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.decl: %AccessMemberWithInvalidBaseFinal_WithMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template = constants.%AccessMemberWithInvalidBaseFinal_WithMember] { -// CHECK:STDOUT: %DeriveFromFinal.ref.loc139: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %p.patt: %.46 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc139_66: type = ptr_type %DeriveFromFinal [template = constants.%.46] -// CHECK:STDOUT: %p.loc139_48.1: %.46 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_WithMember.%p: %.46 = bind_name p, %p.loc139_48.1 -// CHECK:STDOUT: %int.make_type_32.loc139: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc139_72.1: type = value_of_initializer %int.make_type_32.loc139 [template = i32] -// CHECK:STDOUT: %.loc139_72.2: type = converted %int.make_type_32.loc139, %.loc139_72.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_WithMember.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.46 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.46 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc139_72.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc139_72.2: type = converted %int.make_type_32, %.loc139_72.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.decl: %AccessMemberWithInvalidBaseFinal_NoMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template = constants.%AccessMemberWithInvalidBaseFinal_NoMember] { -// CHECK:STDOUT: %DeriveFromFinal.ref.loc143: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %p.patt: %.46 = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc143_64: type = ptr_type %DeriveFromFinal [template = constants.%.46] -// CHECK:STDOUT: %p.loc143_46.1: %.46 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_NoMember.%p: %.46 = bind_name p, %p.loc143_46.1 -// CHECK:STDOUT: %int.make_type_32.loc143: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc143_70.1: type = value_of_initializer %int.make_type_32.loc143 [template = i32] -// CHECK:STDOUT: %.loc143_70.2: type = converted %int.make_type_32.loc143, %.loc143_70.1 [template = i32] -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_NoMember.%return: ref i32 = var +// CHECK:STDOUT: %p.param: %.46 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.46 = bind_name p, %p.param +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc143_70.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc143_70.2: type = converted %int.make_type_32, %.loc143_70.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -589,7 +615,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p: %.7) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p -// CHECK:STDOUT: %.loc25: ref %DeriveFromError = deref %p.ref +// CHECK:STDOUT: %.loc25_75: ref %DeriveFromError = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -605,7 +631,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p: %.16) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.16 = name_ref p, %p -// CHECK:STDOUT: %.loc38: ref %DeriveFromNonType = deref %p.ref +// CHECK:STDOUT: %.loc38_78: ref %DeriveFromNonType = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -623,7 +649,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p: %.17) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p -// CHECK:STDOUT: %.loc59: ref %DeriveFromi32 = deref %p.ref +// CHECK:STDOUT: %.loc59_71: ref %DeriveFromi32 = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -641,7 +667,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p: %.26) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.26 = name_ref p, %p -// CHECK:STDOUT: %.loc78: ref %DeriveFromTuple = deref %p.ref +// CHECK:STDOUT: %.loc78_75: ref %DeriveFromTuple = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -659,7 +685,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p: %.33) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.33 = name_ref p, %p -// CHECK:STDOUT: %.loc100: ref %DeriveFromStruct = deref %p.ref +// CHECK:STDOUT: %.loc100_77: ref %DeriveFromStruct = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -677,7 +703,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p: %.37) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.37 = name_ref p, %p -// CHECK:STDOUT: %.loc124: ref %DeriveFromIncomplete = deref %p.ref +// CHECK:STDOUT: %.loc124_85: ref %DeriveFromIncomplete = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index 5a46e0ec12dc..51d68b2dee45 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -74,15 +74,15 @@ fn D.C.F() {} // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.8] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.8] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -92,7 +92,7 @@ fn D.C.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index d08b219e6bc4..7374c79834af 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -94,11 +94,11 @@ class C4 { // CHECK:STDOUT: .C4 = %C4.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} -// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} -// CHECK:STDOUT: %C3.decl: type = class_decl @C3 [template = constants.%C3] {} -// CHECK:STDOUT: %C4.decl: type = class_decl @C4 [template = constants.%C4] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} {} +// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {} +// CHECK:STDOUT: %C3.decl: type = class_decl @C3 [template = constants.%C3] {} {} +// CHECK:STDOUT: %C4.decl: type = class_decl @C4 [template = constants.%C4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index e72bedecfd0e..62b12e313c9e 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -51,8 +51,8 @@ class C { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 9049cf9806cb..46a8d45c3372 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -74,10 +74,10 @@ class D { // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B1.decl: type = class_decl @B1 [template = constants.%B1] {} -// CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %B1.decl: type = class_decl @B1 [template = constants.%B1] {} {} +// CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B1 { diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 543e41f2d71a..27f08be7142d 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -56,8 +56,8 @@ let b: B = C.base; // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index ecde7410afe0..b01b6ade49ab 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -76,12 +76,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.11) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.11) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,16 +92,18 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: .AccessBInA = %AccessBInA.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: %AccessBInA.decl: %AccessBInA.type = fn_decl @AccessBInA [template = constants.%AccessBInA] { -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %a.loc19_15.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @AccessBInA.%a: %A = bind_name a, %a.loc19_15.1 +// CHECK:STDOUT: %a.patt: %A = binding_pattern a +// 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: @AccessBInA.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index dac1d7b42048..e0906b56b20e 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -50,10 +50,10 @@ fn Make() -> C { // CHECK:STDOUT: .Make = %Make.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @Make.%return: ref %C = var +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 685e8ca85689..bd071e433579 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -107,12 +107,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.17) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.22)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.17) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.22)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -126,27 +126,31 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: .ConvertIncomplete = %ConvertIncomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} -// CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} -// CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} +// CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} {} +// CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} {} +// 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: %B2.ref: type = name_ref B2, %B2.decl [template = constants.%B2] +// CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// 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.loc31_21.1: %.11 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertUnrelated.%p: %.11 = bind_name p, %p.loc31_21.1 -// CHECK:STDOUT: %A1.ref: type = name_ref A1, %A1.decl [template = constants.%A1] +// 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: @ConvertUnrelated.%return: ref %.12 = var +// CHECK:STDOUT: %return: ref %.12 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// 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: %Incomplete.ref: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] +// CHECK:STDOUT: %p.patt: %.23 = binding_pattern p +// 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.%.23] -// CHECK:STDOUT: %p.loc41_22.1: %.23 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertIncomplete.%p: %.23 = bind_name p, %p.loc41_22.1 -// CHECK:STDOUT: %A2.ref: type = name_ref A2, %A2.decl [template = constants.%A2] +// CHECK:STDOUT: %p.param: %.23 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.23 = 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.%.24] -// CHECK:STDOUT: @ConvertIncomplete.%return: ref %.24 = var +// CHECK:STDOUT: %return: ref %.24 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index 2d3ed4dbc269..d20081bf872a 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -67,9 +67,9 @@ base class A { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.8] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.8] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 5e9718f40760..8a0e37adbaf4 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -69,7 +69,7 @@ class Class { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 05d43bbce09e..f174ea4ca429 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -73,46 +73,54 @@ 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.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { +// CHECK:STDOUT: %self.patt: = binding_pattern self +// CHECK:STDOUT: %n.patt: = binding_pattern n +// 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.loc32_10.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc32_10.2: i32 = bind_symbolic_name N 0, %N.loc32_10.1 [symbolic = @.1.%N (constants.%N)] +// CHECK:STDOUT: %N.param: i32 = param N, runtime_param +// CHECK:STDOUT: %N.loc32: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] -// CHECK:STDOUT: %self.loc32_21.1: = param self, runtime_param0 -// CHECK:STDOUT: @.1.%self: = bind_name self, %self.loc32_21.1 +// 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.loc32_33.1: = param n, runtime_param1 -// CHECK:STDOUT: @.1.%n: = bind_name n, %n.loc32_33.1 +// CHECK:STDOUT: %n.param: = param n, runtime_param1 +// CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] -// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%.1 (%.2) = field_decl a, element0 [template] -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @F.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = @F.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc13_8.1: @F.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8.2: @F.%Class (%Class.2) = bind_name self, %self.loc13_8.1 -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, file.%T.loc11_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %n.loc13_20.1: @F.%T (%T) = param n, runtime_param1 -// CHECK:STDOUT: %n.loc13_20.2: @F.%T (%T) = bind_name n, %n.loc13_20.1 +// 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: %n.patt: @F.%T (%T) = binding_pattern n +// 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 [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: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -123,17 +131,17 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @F(@Class.%T.loc11: type) { // 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[@Class.%self.loc13_8.2: @F.%Class (%Class.2)](@Class.%n.loc13_20.2: @F.%T (%T)); +// CHECK:STDOUT: fn[%self: @F.%Class (%Class.2)](%n: @F.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%N.loc32_10.2: i32) { -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic fn @.1(%N.loc32: i32) { +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 0 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -144,11 +152,11 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { @@ -156,11 +164,11 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%N) { -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index df34b8229ffc..46b2a9885d22 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -72,8 +72,8 @@ var a: Incomplete; // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { @@ -120,7 +120,7 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} {} // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.2 [template = constants.%Incomplete] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 27b40443804d..04f1e1dc59b0 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -200,66 +200,78 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} -// CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [template = constants.%CallClassFunction] {} -// CHECK:STDOUT: %Class.ref.loc40: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} +// CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [template = constants.%CallClassFunction] {} {} +// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %global_var.var: ref = var global_var // CHECK:STDOUT: %global_var: ref = bind_name global_var, %global_var.var -// CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [template = constants.%ConvertFromStruct] { -// CHECK:STDOUT: %Class.ref.loc49: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @ConvertFromStruct.%return: ref %Class = var +// CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [template = constants.%ConvertFromStruct] {} { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %return: ref %Class = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Class.ref.loc51: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc51_6.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @G.%p: %.4 = bind_name p, %p.loc51_6.1 -// CHECK:STDOUT: %int.make_type_32.loc51: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc51_20.1: type = value_of_initializer %int.make_type_32.loc51 [template = i32] -// CHECK:STDOUT: %.loc51_20.2: type = converted %int.make_type_32.loc51, %.loc51_20.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// 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: } // CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [template = constants.%MemberAccess] { -// CHECK:STDOUT: %Class.ref.loc62: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc62_17.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @MemberAccess.%p: %.4 = bind_name p, %p.loc62_17.1 -// CHECK:STDOUT: %int.make_type_32.loc62: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc62_31.1: type = value_of_initializer %int.make_type_32.loc62 [template = i32] -// CHECK:STDOUT: %.loc62_31.2: type = converted %int.make_type_32.loc62, %.loc62_31.1 [template = i32] -// CHECK:STDOUT: @MemberAccess.%return: ref i32 = var +// 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: } // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] { -// CHECK:STDOUT: %Class.ref.loc80_12: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc80_9.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @Copy.%p: %.4 = bind_name p, %p.loc80_9.1 -// CHECK:STDOUT: %Class.ref.loc80_23: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @Copy.%return: ref %Class = var +// 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: } // CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] { -// CHECK:STDOUT: %Class.ref.loc84: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc84_8.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @Let.%p: %.4 = bind_name p, %p.loc84_8.1 +// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [template = constants.%TakeIncomplete] { -// CHECK:STDOUT: %Class.ref.loc95: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc95_19.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @TakeIncomplete.%c: %Class = bind_name c, %c.loc95_19.1 +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// 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: } -// CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [template = constants.%ReturnIncomplete] { -// CHECK:STDOUT: %Class.ref.loc97: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @ReturnIncomplete.%return: ref %Class = var +// 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] +// CHECK:STDOUT: %return: ref %Class = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallTakeIncomplete.decl: %CallTakeIncomplete.type = fn_decl @CallTakeIncomplete [template = constants.%CallTakeIncomplete] { -// CHECK:STDOUT: %Class.ref.loc99: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc99_23.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @CallTakeIncomplete.%p: %.4 = bind_name p, %p.loc99_23.1 +// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: } -// CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [template = constants.%CallReturnIncomplete] {} +// CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [template = constants.%CallReturnIncomplete] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class; @@ -307,7 +319,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Let(%p: %.4) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref.loc92: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc92: ref %Class = deref %p.ref // CHECK:STDOUT: %c: = bind_name c, diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index a0b8342210ce..3191dab4e0a5 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -73,8 +73,8 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 7f14d77f6a4a..8c0b1dd3c257 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -70,14 +70,16 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p +// 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.loc16_6.1: %.5 = param p, runtime_param0 -// CHECK:STDOUT: @G.%p: %.5 = bind_name p, %p.loc16_6.1 +// CHECK:STDOUT: %p.param: %.5 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index e56369525006..8562635393a3 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -80,26 +80,31 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] +// CHECK:STDOUT: %s.patt: %.7 = binding_pattern s +// CHECK:STDOUT: %b.patt: %B = binding_pattern b +// 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.loc19_6.1: %.7 = param s, runtime_param0 -// CHECK:STDOUT: @F.2.%s: %.7 = bind_name s, %s.loc19_6.1 -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %b.loc19_18.1: %B = param b, runtime_param1 -// CHECK:STDOUT: @F.2.%b: %B = bind_name b, %b.loc19_18.1 +// 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: } // 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: } { // 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.loc12_13.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 +// 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: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -118,7 +123,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: .a = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[addr @A.%self.loc12_13.3: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self: %.1](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%s: %.7, %b: %B) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 0ee890aadee6..521c78c95ffe 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -62,16 +62,16 @@ fn T.F() {} // CHECK:STDOUT: .T = @__global_init.%T // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // 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: %return.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 428d6c1fde78..88f2ad41dff1 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -83,23 +83,27 @@ fn F(c: Class) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %WithSelf.ref: %WithSelf.type = name_ref WithSelf, @Class.%WithSelf.decl [template = constants.%WithSelf] // 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: %Class.ref.loc18: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc18_6.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @F.%c: %Class = bind_name c, %c.loc18_6.1 +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %NoSelf.decl: %NoSelf.type = fn_decl @NoSelf [template = constants.%NoSelf] {} +// 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: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.loc13_15.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_15.2: %Class = bind_name self, %self.loc13_15.1 +// CHECK:STDOUT: %self.param: %Class = param self, runtime_param0 +// CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -111,7 +115,7 @@ fn F(c: Class) { // CHECK:STDOUT: // CHECK:STDOUT: fn @NoSelf(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @WithSelf[@Class.%self.loc13_15.2: %Class](); +// CHECK:STDOUT: fn @WithSelf[%self: %Class](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c: %Class) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 7d213fbab901..152ac780115e 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -97,21 +97,25 @@ base class BaseClass { // CHECK:STDOUT: .BaseClass = %BaseClass.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %FinalClass.decl: type = class_decl @FinalClass [template = constants.%FinalClass] {} -// CHECK:STDOUT: %AbstractClass.decl: type = class_decl @AbstractClass [template = constants.%AbstractClass] {} -// CHECK:STDOUT: %BaseClass.decl: type = class_decl @BaseClass [template = constants.%BaseClass] {} +// CHECK:STDOUT: %FinalClass.decl: type = class_decl @FinalClass [template = constants.%FinalClass] {} {} +// CHECK:STDOUT: %AbstractClass.decl: type = class_decl @AbstractClass [template = constants.%AbstractClass] {} {} +// CHECK:STDOUT: %BaseClass.decl: type = class_decl @BaseClass [template = constants.%BaseClass] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FinalClass { // CHECK:STDOUT: %Abstract.decl: %Abstract.type.1 = fn_decl @Abstract.1 [template = constants.%Abstract.1] { -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] -// CHECK:STDOUT: %self.loc20_24.1: %FinalClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_24.2: %FinalClass = bind_name self, %self.loc20_24.1 +// CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self +// 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: } // CHECK:STDOUT: %Virtual.decl: %Virtual.type = fn_decl @Virtual [template = constants.%Virtual] { -// CHECK:STDOUT: %Self.ref.loc29: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] -// CHECK:STDOUT: %self.loc29_22.1: %FinalClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc29_22.2: %FinalClass = bind_name self, %self.loc29_22.1 +// CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self +// 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: } // CHECK:STDOUT: %.loc30: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -123,14 +127,18 @@ base class BaseClass { // CHECK:STDOUT: // CHECK:STDOUT: class @AbstractClass { // CHECK:STDOUT: %Default.decl: %Default.type = fn_decl @Default [template = constants.%Default] { -// CHECK:STDOUT: %Self.ref.loc38: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] -// CHECK:STDOUT: %self.loc38_22.1: %AbstractClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc38_22.2: %AbstractClass = bind_name self, %self.loc38_22.1 +// CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self +// 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: } // CHECK:STDOUT: %Final.decl: %Final.type = fn_decl @Final [template = constants.%Final] { -// CHECK:STDOUT: %Self.ref.loc44: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] -// CHECK:STDOUT: %self.loc44_18.1: %AbstractClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc44_18.2: %AbstractClass = bind_name self, %self.loc44_18.1 +// CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self +// 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: } // CHECK:STDOUT: %.loc45: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -142,9 +150,11 @@ base class BaseClass { // CHECK:STDOUT: // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%BaseClass [template = constants.%BaseClass] -// CHECK:STDOUT: %self.loc55_24.1: %BaseClass = param self, runtime_param0 -// CHECK:STDOUT: %self.loc55_24.2: %BaseClass = bind_name self, %self.loc55_24.1 +// CHECK:STDOUT: %self.param: %BaseClass = param self, runtime_param0 +// CHECK:STDOUT: %self: %BaseClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc56: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -153,13 +163,13 @@ base class BaseClass { // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Abstract.1[@FinalClass.%self.loc20_24.2: %FinalClass](); +// CHECK:STDOUT: fn @Abstract.1[%self: %FinalClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Virtual[@FinalClass.%self.loc29_22.2: %FinalClass](); +// CHECK:STDOUT: fn @Virtual[%self: %FinalClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Default[@AbstractClass.%self.loc38_22.2: %AbstractClass](); +// CHECK:STDOUT: fn @Default[%self: %AbstractClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Final[@AbstractClass.%self.loc44_18.2: %AbstractClass](); +// CHECK:STDOUT: fn @Final[%self: %AbstractClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Abstract.2[@BaseClass.%self.loc55_24.2: %BaseClass](); +// CHECK:STDOUT: fn @Abstract.2[%self: %BaseClass](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index f157e7d32258..65a5f8eaed80 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -49,12 +49,12 @@ class Class { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc19: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc19: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 8bd51404b5b1..77a3f296707f 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -106,12 +106,12 @@ abstract base class AbstractAndBase {} // CHECK:STDOUT: .AbstractAndBase = %AbstractAndBase.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %DuplicatePrivate.decl: type = class_decl @DuplicatePrivate [template = constants.%DuplicatePrivate] {} -// CHECK:STDOUT: %TwoAccess.decl: type = class_decl @TwoAccess [template = constants.%TwoAccess] {} -// CHECK:STDOUT: %TwoAbstract.decl: type = class_decl @TwoAbstract [template = constants.%TwoAbstract] {} -// CHECK:STDOUT: %Virtual.decl: type = class_decl @Virtual [template = constants.%Virtual] {} -// CHECK:STDOUT: %WrongOrder.decl: type = class_decl @WrongOrder [template = constants.%WrongOrder] {} -// CHECK:STDOUT: %AbstractAndBase.decl: type = class_decl @AbstractAndBase [template = constants.%AbstractAndBase] {} +// CHECK:STDOUT: %DuplicatePrivate.decl: type = class_decl @DuplicatePrivate [template = constants.%DuplicatePrivate] {} {} +// CHECK:STDOUT: %TwoAccess.decl: type = class_decl @TwoAccess [template = constants.%TwoAccess] {} {} +// CHECK:STDOUT: %TwoAbstract.decl: type = class_decl @TwoAbstract [template = constants.%TwoAbstract] {} {} +// CHECK:STDOUT: %Virtual.decl: type = class_decl @Virtual [template = constants.%Virtual] {} {} +// CHECK:STDOUT: %WrongOrder.decl: type = class_decl @WrongOrder [template = constants.%WrongOrder] {} {} +// CHECK:STDOUT: %AbstractAndBase.decl: type = class_decl @AbstractAndBase [template = constants.%AbstractAndBase] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DuplicatePrivate; diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index 9b19dab24fc8..0073586dda02 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -45,8 +45,8 @@ fn C.F() {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // 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: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 0f3811617fea..800ec4e70f1e 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -118,8 +118,8 @@ base class F {} // CHECK:STDOUT: .A = %A.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc12: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %A.decl.loc12: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -156,8 +156,8 @@ base class F {} // CHECK:STDOUT: .B = %B.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl.loc4: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl.loc4: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { @@ -194,8 +194,8 @@ base class F {} // CHECK:STDOUT: .C = %C.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -232,8 +232,8 @@ base class F {} // CHECK:STDOUT: .D = %D.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %D.decl.loc4: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %D.decl.loc12: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl.loc4: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %D.decl.loc12: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -270,8 +270,8 @@ base class F {} // CHECK:STDOUT: .E = %E.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %E.decl.loc4: type = class_decl @E [template = constants.%E] {} -// CHECK:STDOUT: %E.decl.loc12: type = class_decl @E [template = constants.%E] {} +// CHECK:STDOUT: %E.decl.loc4: type = class_decl @E [template = constants.%E] {} {} +// CHECK:STDOUT: %E.decl.loc12: type = class_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -308,8 +308,8 @@ base class F {} // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl.loc4: type = class_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc11: type = class_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: type = class_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc11: type = class_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @F { diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 9c1e8a76209e..62ca87fb7879 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -60,14 +60,14 @@ class Y { // CHECK:STDOUT: .Y = %Y.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl.loc11: type = class_decl @A.1 [template = constants.%A.1] {} -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: %A.decl.loc19: type = class_decl @A.1 [template = constants.%A.1] {} -// CHECK:STDOUT: %Y.decl: type = class_decl @Y [template = constants.%Y] {} +// CHECK:STDOUT: %A.decl.loc11: type = class_decl @A.1 [template = constants.%A.1] {} {} +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: %A.decl.loc19: type = class_decl @A.1 [template = constants.%A.1] {} {} +// CHECK:STDOUT: %Y.decl: type = class_decl @Y [template = constants.%Y] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A.1 { -// CHECK:STDOUT: %B.decl: type = class_decl @B.2 [template = constants.%B.2] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B.2 [template = constants.%B.2] {} {} // CHECK:STDOUT: %.loc19: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -76,8 +76,8 @@ class Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: %A.decl: type = class_decl @A.2 [template = constants.%A.2] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A.2 [template = constants.%A.2] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} {} // CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -86,7 +86,7 @@ class Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A.2 { -// CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} {} // CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -104,7 +104,7 @@ class Y { // CHECK:STDOUT: class @B.2; // CHECK:STDOUT: // CHECK:STDOUT: class @Y { -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} {} // CHECK:STDOUT: %.loc26: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index b1c5e502a864..63a9c0983c4c 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -85,18 +85,18 @@ fn Class.I() {} // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.4] {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] {} -// CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} -// CHECK:STDOUT: %I.decl: %I.type.1 = fn_decl @I.1 [template = constants.%I.1] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.4] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] {} {} +// CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} {} +// CHECK:STDOUT: %I.decl: %I.type.1 = fn_decl @I.1 [template = constants.%I.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} -// CHECK:STDOUT: %I.decl: %I.type.1 = fn_decl @I.1 [template = constants.%I.1] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} {} +// CHECK:STDOUT: %I.decl: %I.type.1 = fn_decl @I.1 [template = constants.%I.1] {} {} // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -108,9 +108,9 @@ fn Class.I() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { -// CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] {} -// CHECK:STDOUT: %H.decl: %H.type.2 = fn_decl @H.2 [template = constants.%H.2] {} -// CHECK:STDOUT: %I.decl: %I.type.2 = fn_decl @I.2 [template = constants.%I.2] {} +// CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] {} {} +// CHECK:STDOUT: %H.decl: %H.type.2 = fn_decl @H.2 [template = constants.%H.2] {} {} +// CHECK:STDOUT: %I.decl: %I.type.2 = fn_decl @I.2 [template = constants.%I.2] {} {} // CHECK:STDOUT: %.loc28: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 9a0de15a65c2..428086001797 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -59,21 +59,21 @@ fn G() -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// 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] // CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_32, %.loc17_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // 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: %return.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 2fc297812be5..2be3a5dde32a 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -102,12 +102,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -118,21 +118,25 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: .CallWrongSelf = %CallWrongSelf.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: } { // CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc25_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @F.1.%self: %Class = bind_name self, %self.loc25_12.1 +// CHECK:STDOUT: %self.param.loc25: %Class = param self, runtime_param0 +// CHECK:STDOUT: %self.loc25: %Class = bind_name self, %self.param.loc25 // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// 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] -// CHECK:STDOUT: @G.%return: ref %Class = var +// CHECK:STDOUT: %return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %WrongSelf.decl: type = class_decl @WrongSelf [template = constants.%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: %WrongSelf.ref: type = name_ref WrongSelf, %WrongSelf.decl [template = constants.%WrongSelf] -// CHECK:STDOUT: %ws.loc45_18.1: %WrongSelf = param ws, runtime_param0 -// CHECK:STDOUT: @CallWrongSelf.%ws: %WrongSelf = bind_name ws, %ws.loc45_18.1 +// CHECK:STDOUT: %ws.patt: %WrongSelf = binding_pattern ws +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,13 +161,15 @@ fn CallWrongSelf(ws: WrongSelf) { // 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: %Class = binding_pattern self +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc16_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_8.2: %Class = bind_name self, %self.loc16_8.1 +// CHECK:STDOUT: %self.param.loc16: %Class = param self, runtime_param0 +// CHECK:STDOUT: %self.loc16: %Class = bind_name self, %self.param.loc16 // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// 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] -// CHECK:STDOUT: %return.var: ref %Class = var +// CHECK:STDOUT: %return.var.loc18: ref %Class = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -175,9 +181,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // 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: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.loc42_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc42_8.2: %Class = bind_name self, %self.loc42_8.1 +// CHECK:STDOUT: %self.param: %Class = param self, runtime_param0 +// CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc43: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -186,14 +194,14 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1(%self: %Class) { +// CHECK:STDOUT: fn @F.1(%self.loc25: %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %Self.ref.loc33: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.var: ref %Class = var self // CHECK:STDOUT: %self: ref %Class = bind_name self, %self.var // CHECK:STDOUT: %self.ref: ref %Class = name_ref self, %self @@ -201,7 +209,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[@WrongSelf.%self.loc42_8.2: %Class](); +// CHECK:STDOUT: fn @F.2[%self: %Class](); // CHECK:STDOUT: // CHECK:STDOUT: fn @CallWrongSelf(%ws: %WrongSelf) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index e3cb4c65a63f..2c5110254d50 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -40,7 +40,7 @@ class A { // CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc27: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index c17cadbffe7a..0fc524d7cdf3 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -65,25 +65,25 @@ fn G() -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// 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] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32, %.loc22_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_14.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_14.2: type = converted %int.make_type_32.loc12, %.loc12_14.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_14.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc12_14.2: type = converted %int.make_type_32, %.loc12_14.1 [template = i32] // CHECK:STDOUT: %.loc12_12: %.2 = field_decl field, element0 [template] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 4d8ccce4e4c6..374e997f8453 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -57,15 +57,17 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc15_6.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: %Class = bind_name c, %c.loc15_6.1 +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// 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: @G.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index a0a58bb3f96c..adff95814e95 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -60,8 +60,8 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 5659319a7f8e..53a6fa1153ad 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -61,8 +61,8 @@ fn Test() { // CHECK:STDOUT: .Test = %Test.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index 43a5b552d4f7..a65ef852a06c 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -42,15 +42,17 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: %Class.ref.loc13_9: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// 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.loc13_6.1: %.1 = param p, runtime_param0 -// CHECK:STDOUT: @F.%p: %.1 = bind_name p, %p.loc13_6.1 -// CHECK:STDOUT: %Class.ref.loc13_20: type = name_ref Class, %Class.decl [template = constants.%Class] +// 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: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic.carbon b/toolchain/check/testdata/class/generic.carbon index 88857e76b213..792313b41dd7 100644 --- a/toolchain/check/testdata/class/generic.carbon +++ b/toolchain/check/testdata/class/generic.carbon @@ -38,7 +38,7 @@ class C[](); // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {} +// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index ff80b07224e5..44a013b01242 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -67,49 +67,57 @@ 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.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Declaration.decl: %Declaration.type = class_decl @Declaration [template = constants.%Declaration.1] { -// CHECK:STDOUT: %T.loc24_19.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc24_19.2: type = bind_symbolic_name T 0, %T.loc24_19.1 [symbolic = @Declaration.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc24: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T) [symbolic = %GetAddr.type (constants.%GetAddr.type)] +// CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T.1) [symbolic = %GetAddr.type (constants.%GetAddr.type)] // CHECK:STDOUT: %GetAddr: @Class.%GetAddr.type (%GetAddr.type) = struct_value () [symbolic = %GetAddr (constants.%GetAddr)] -// CHECK:STDOUT: %GetValue.type: type = fn_type @GetValue, @Class(%T) [symbolic = %GetValue.type (constants.%GetValue.type)] +// CHECK:STDOUT: %GetValue.type: type = fn_type @GetValue, @Class(%T.1) [symbolic = %GetValue.type (constants.%GetValue.type)] // CHECK:STDOUT: %GetValue: @Class.%GetValue.type (%GetValue.type) = struct_value () [symbolic = %GetValue (constants.%GetValue)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T (%T)} [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.5)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.5) [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type) = fn_decl @GetAddr [symbolic = %GetAddr (constants.%GetAddr)] { -// CHECK:STDOUT: %.loc12_25: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @GetAddr.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, %.loc12_25 [symbolic = @GetAddr.%Class (constants.%Class.2)] -// CHECK:STDOUT: %.loc12_29: type = ptr_type %Class.2 [symbolic = @GetAddr.%.1 (constants.%.2)] -// CHECK:STDOUT: %self.loc12_19.1: @GetAddr.%.1 (%.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_19.3: @GetAddr.%.1 (%.2) = bind_name self, %self.loc12_19.1 -// CHECK:STDOUT: %.loc12_14: @GetAddr.%.1 (%.2) = addr_pattern %self.loc12_19.3 -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = @GetAddr.%T (constants.%T)] -// CHECK:STDOUT: %.loc12_38: type = ptr_type %T [symbolic = @GetAddr.%.2 (constants.%.3)] -// CHECK:STDOUT: %return.var.loc12: ref @GetAddr.%.2 (%.3) = var +// CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type) = fn_decl @GetAddr [symbolic = @Class.%GetAddr (constants.%GetAddr)] { +// CHECK:STDOUT: %self.patt: @GetAddr.%.1 (%.2) = binding_pattern self +// 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: type = ptr_type %Class.2 [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %self.param: @GetAddr.%.1 (%.2) = param self, runtime_param0 +// CHECK:STDOUT: %self: @GetAddr.%.1 (%.2) = bind_name self, %self.param +// CHECK:STDOUT: %.loc12_14: @GetAddr.%.1 (%.2) = addr_pattern %self +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc12_38: type = ptr_type %T [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %return: ref @GetAddr.%.2 (%.3) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %GetValue.decl: @Class.%GetValue.type (%GetValue.type) = fn_decl @GetValue [symbolic = %GetValue (constants.%GetValue)] { -// CHECK:STDOUT: %.loc17: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @GetValue.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, %.loc17 [symbolic = @GetValue.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc17_15.1: @GetValue.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17_15.2: @GetValue.%Class (%Class.2) = bind_name self, %self.loc17_15.1 -// CHECK:STDOUT: %T.ref.loc17: type = name_ref T, file.%T.loc11_13.2 [symbolic = @GetValue.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc17: ref @GetValue.%T (%T) = var +// 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: } { +// 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 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @GetValue.%T (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc21: @Class.%.1 (%.4) = field_decl k, element0 [template] // CHECK:STDOUT: %.loc22: = complete_type_witness %.5 [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: @@ -121,13 +129,13 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Declaration(file.%T.loc24_19.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Declaration(%T.loc24: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GetAddr(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @GetAddr(@Class.%T.loc11: type) { // 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: %.1: type = ptr_type @GetAddr.%Class (%Class.2) [symbolic = %.1 (constants.%.2)] @@ -136,9 +144,9 @@ class Declaration(T:! type); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.3: type = unbound_element_type @GetAddr.%Class (%Class.2), @GetAddr.%T (%T) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr @Class.%self.loc12_19.3: @GetAddr.%.1 (%.2)]() -> @GetAddr.%.2 (%.3) { +// CHECK:STDOUT: fn[addr %self: @GetAddr.%.1 (%.2)]() -> @GetAddr.%.2 (%.3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @GetAddr.%.1 (%.2) = name_ref self, @Class.%self.loc12_19.3 +// CHECK:STDOUT: %self.ref: @GetAddr.%.1 (%.2) = name_ref self, %self // CHECK:STDOUT: %.loc13_17.1: ref @GetAddr.%Class (%Class.2) = deref %self.ref // CHECK:STDOUT: %k.ref: @GetAddr.%.3 (%.4) = name_ref k, @Class.%.loc21 [template = @Class.%.loc21] // CHECK:STDOUT: %.loc13_17.2: ref @GetAddr.%T (%T) = class_element_access %.loc13_17.1, element0 @@ -147,16 +155,16 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GetValue(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @GetValue(@Class.%T.loc11: type) { // 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: !definition: // CHECK:STDOUT: %.1: type = unbound_element_type @GetValue.%Class (%Class.2), @GetValue.%T (%T) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Class.%self.loc17_15.2: @GetValue.%Class (%Class.2)]() -> @GetValue.%T (%T) { +// CHECK:STDOUT: fn[%self: @GetValue.%Class (%Class.2)]() -> @GetValue.%T (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @GetValue.%Class (%Class.2) = name_ref self, @Class.%self.loc17_15.2 +// CHECK:STDOUT: %self.ref: @GetValue.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %k.ref: @GetValue.%.1 (%.4) = name_ref k, @Class.%.loc21 [template = @Class.%.loc21] // CHECK:STDOUT: %.loc18_16.1: ref @GetValue.%T (%T) = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc18_16.2: @GetValue.%T (%T) = bind_value %.loc18_16.1 @@ -165,7 +173,7 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type @@ -179,7 +187,7 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetAddr.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { @@ -190,7 +198,7 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetValue.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetValue(constants.%T) { @@ -198,11 +206,11 @@ class Declaration(T:! type); // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Declaration(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => 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 228f76d16371..421b7b4506e0 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -130,18 +130,21 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.loc4_23.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = @Class.%N (constants.%N)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N 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 = %T.1 (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: i32 = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (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.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32.loc6, %.loc6_17.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32, %.loc6_17.1 [template = i32] // CHECK:STDOUT: %.loc6_17.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %.loc6_20: i32 = int_literal 5 [template = constants.%.5] // CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.4, constants.%.5) [template = constants.%Class.3] @@ -156,14 +159,14 @@ class Outer(T:! type) { // CHECK:STDOUT: %b: ref %Class.4 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type, file.%N.loc4_23.2: i32) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type, %N.loc4: i32) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -173,20 +176,20 @@ class Outer(T:! type) { // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%.4, constants.%.5) { -// CHECK:STDOUT: %T => constants.%.4 -// CHECK:STDOUT: %N => constants.%.5 +// CHECK:STDOUT: %T.1 => constants.%.4 +// CHECK:STDOUT: %N.1 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%.1, constants.%.7) { -// CHECK:STDOUT: %T => constants.%.1 -// CHECK:STDOUT: %N => constants.%.7 +// CHECK:STDOUT: %T.1 => constants.%.1 +// CHECK:STDOUT: %N.1 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -230,31 +233,34 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.loc4_23.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = @Class.%N (constants.%N)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N 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 = %T.1 (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: i32 = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (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.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32] // CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type, file.%N.loc4_23.2: i32) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type, %N.loc4: i32) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -264,8 +270,8 @@ class Outer(T:! type) { // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_too_many.carbon @@ -309,18 +315,21 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.loc4_23.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = @Class.%N (constants.%N)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N 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 = %T.1 (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: i32 = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (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.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32] // CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.6] @@ -328,14 +337,14 @@ class Outer(T:! type) { // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type, file.%N.loc4_23.2: i32) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type, %N.loc4: i32) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -345,8 +354,8 @@ class Outer(T:! type) { // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_conversion.carbon @@ -396,12 +405,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -412,19 +421,22 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.loc4_23.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = @Class.%N (constants.%N)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N 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 = %T.1 (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: i32 = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (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: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_32.loc15, %.loc15_20.1 [template = i32] +// 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: %.loc15_13.1: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.9] // CHECK:STDOUT: %.loc15_13.2: %.10 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.11] @@ -453,14 +465,14 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type, file.%N.loc4_23.2: i32) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type, %N.loc4: i32) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -478,8 +490,8 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -573,22 +585,26 @@ 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.loc2_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T 0, %T.loc2_13.1 [symbolic = @Outer.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc2: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Outer(file.%T.loc2_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Outer(%T.loc2: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.1)] +// CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.1) [symbolic = %Inner.type (constants.%Inner.type.1)] // CHECK:STDOUT: %Inner: @Outer.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner (constants.%Inner.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.1) = class_decl @Inner [symbolic = %Inner (constants.%Inner.1)] { -// CHECK:STDOUT: %U.loc3_15.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc3_15.2: type = bind_symbolic_name U 1, %U.loc3_15.1 [symbolic = @Inner.%U (constants.%U)] +// 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: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc3: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -598,46 +614,46 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Inner(file.%T.loc2_13.2: type, @Outer.%U.loc3_15.2: type) { -// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc2: type, %U.loc3: type) { +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %A.type: type = fn_type @A, @Inner(%T, %U) [symbolic = %A.type (constants.%A.type.1)] +// CHECK:STDOUT: %A.type: type = fn_type @A, @Inner(%T, %U.1) [symbolic = %A.type (constants.%A.type.1)] // CHECK:STDOUT: %A: @Inner.%A.type (%A.type.1) = struct_value () [symbolic = %A (constants.%A.1)] -// CHECK:STDOUT: %B.type: type = fn_type @B, @Inner(%T, %U) [symbolic = %B.type (constants.%B.type.1)] +// CHECK:STDOUT: %B.type: type = fn_type @B, @Inner(%T, %U.1) [symbolic = %B.type (constants.%B.type.1)] // CHECK:STDOUT: %B: @Inner.%B.type (%B.type.1) = struct_value () [symbolic = %B (constants.%B.1)] -// CHECK:STDOUT: %C.type: type = fn_type @C, @Inner(%T, %U) [symbolic = %C.type (constants.%C.type.1)] +// CHECK:STDOUT: %C.type: type = fn_type @C, @Inner(%T, %U.1) [symbolic = %C.type (constants.%C.type.1)] // CHECK:STDOUT: %C: @Inner.%C.type (%C.type.1) = struct_value () [symbolic = %C (constants.%C.1)] -// CHECK:STDOUT: %D.type: type = fn_type @D, @Inner(%T, %U) [symbolic = %D.type (constants.%D.type.1)] +// CHECK:STDOUT: %D.type: type = fn_type @D, @Inner(%T, %U.1) [symbolic = %D.type (constants.%D.type.1)] // CHECK:STDOUT: %D: @Inner.%D.type (%D.type.1) = struct_value () [symbolic = %D (constants.%D.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %A.decl: @Inner.%A.type (%A.type.1) = fn_decl @A [symbolic = %A (constants.%A.1)] { -// CHECK:STDOUT: %Outer.ref.loc4: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, file.%T.loc2_13.2 [symbolic = @A.%T (constants.%T)] -// CHECK:STDOUT: %Outer.loc4: type = class_type @Outer, @Outer(constants.%T) [symbolic = @A.%Outer (constants.%Outer.2)] -// CHECK:STDOUT: %return.var.loc4: ref @A.%Outer (%Outer.2) = var +// CHECK:STDOUT: %A.decl: @Inner.%A.type (%A.type.1) = fn_decl @A [symbolic = @Inner.%A (constants.%A.1)] {} { +// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] +// CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %Outer.loc4: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.1 (constants.%Outer.2)] +// CHECK:STDOUT: %return: ref @A.%Outer.1 (%Outer.2) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: @Inner.%B.type (%B.type.1) = fn_decl @B [symbolic = %B (constants.%B.1)] { -// CHECK:STDOUT: %Outer.ref.loc7: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] -// CHECK:STDOUT: %U.ref.loc7: type = name_ref U, @Outer.%U.loc3_15.2 [symbolic = @B.%U (constants.%U)] -// CHECK:STDOUT: %Outer.loc7: type = class_type @Outer, @Outer(constants.%U) [symbolic = @B.%Outer (constants.%Outer.3)] -// CHECK:STDOUT: %return.var.loc7: ref @B.%Outer (%Outer.3) = var +// CHECK:STDOUT: %B.decl: @Inner.%B.type (%B.type.1) = fn_decl @B [symbolic = @Inner.%B (constants.%B.1)] {} { +// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] +// CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: %Outer.loc7: type = class_type @Outer, @Outer(constants.%U) [symbolic = %Outer.1 (constants.%Outer.3)] +// CHECK:STDOUT: %return: ref @B.%Outer.1 (%Outer.3) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: @Inner.%C.type (%C.type.1) = fn_decl @C [symbolic = %C (constants.%C.1)] { -// CHECK:STDOUT: %.loc10: @C.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = @C.%Inner.1 (constants.%Inner.1)] -// CHECK:STDOUT: %Inner.ref.loc10: @C.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc10 [symbolic = @C.%Inner.1 (constants.%Inner.1)] -// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, file.%T.loc2_13.2 [symbolic = @C.%T (constants.%T)] -// CHECK:STDOUT: %Inner.loc10: type = class_type @Inner, @Inner(constants.%T, constants.%T) [symbolic = @C.%Inner.2 (constants.%Inner.3)] -// CHECK:STDOUT: %return.var.loc10: ref @C.%Inner.2 (%Inner.3) = var +// CHECK:STDOUT: %C.decl: @Inner.%C.type (%C.type.1) = fn_decl @C [symbolic = @Inner.%C (constants.%C.1)] {} { +// CHECK:STDOUT: %.loc10: @C.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.1 (constants.%Inner.1)] +// CHECK:STDOUT: %Inner.ref: @C.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc10 [symbolic = %Inner.1 (constants.%Inner.1)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %Inner.loc10: type = class_type @Inner, @Inner(constants.%T, constants.%T) [symbolic = %Inner.2 (constants.%Inner.3)] +// CHECK:STDOUT: %return: ref @C.%Inner.2 (%Inner.3) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: @Inner.%D.type (%D.type.1) = fn_decl @D [symbolic = %D (constants.%D.1)] { -// CHECK:STDOUT: %.loc13: @D.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = @D.%Inner.1 (constants.%Inner.1)] -// CHECK:STDOUT: %Inner.ref.loc13: @D.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13 [symbolic = @D.%Inner.1 (constants.%Inner.1)] -// CHECK:STDOUT: %U.ref.loc13: type = name_ref U, @Outer.%U.loc3_15.2 [symbolic = @D.%U (constants.%U)] -// CHECK:STDOUT: %Inner.loc13: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = @D.%Inner.2 (constants.%Inner.2)] -// CHECK:STDOUT: %return.var.loc13: ref @D.%Inner.2 (%Inner.2) = var +// CHECK:STDOUT: %D.decl: @Inner.%D.type (%D.type.1) = fn_decl @D [symbolic = @Inner.%D (constants.%D.1)] {} { +// CHECK:STDOUT: %.loc13: @D.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.1 (constants.%Inner.1)] +// CHECK:STDOUT: %Inner.ref: @D.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13 [symbolic = %Inner.1 (constants.%Inner.1)] +// CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: %Inner.loc13: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.2 (constants.%Inner.2)] +// CHECK:STDOUT: %return: ref @D.%Inner.2 (%Inner.2) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -650,39 +666,39 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @A(file.%T.loc2_13.2: type, @Outer.%U.loc3_15.2: type) { +// CHECK:STDOUT: generic fn @A(@Outer.%T.loc2: type, @Inner.%U.loc3: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%T) [symbolic = %Outer (constants.%Outer.2)] +// CHECK:STDOUT: %Outer.1: type = class_type @Outer, @Outer(%T) [symbolic = %Outer.1 (constants.%Outer.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %struct: @A.%Outer (%Outer.2) = struct_value () [symbolic = %struct (constants.%struct.1)] +// CHECK:STDOUT: %struct: @A.%Outer.1 (%Outer.2) = struct_value () [symbolic = %struct (constants.%struct.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Inner.%return.var.loc4: @A.%Outer (%Outer.2) { +// CHECK:STDOUT: fn() -> %return: @A.%Outer.1 (%Outer.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc5_15.1: %.2 = struct_literal () -// CHECK:STDOUT: %.loc5_15.2: init @A.%Outer (%Outer.2) = class_init (), @Inner.%return.var.loc4 [symbolic = %struct (constants.%struct.1)] -// CHECK:STDOUT: %.loc5_16: init @A.%Outer (%Outer.2) = converted %.loc5_15.1, %.loc5_15.2 [symbolic = %struct (constants.%struct.1)] -// CHECK:STDOUT: return %.loc5_16 to @Inner.%return.var.loc4 +// CHECK:STDOUT: %.loc5_15.2: init @A.%Outer.1 (%Outer.2) = class_init (), %return [symbolic = %struct (constants.%struct.1)] +// CHECK:STDOUT: %.loc5_16: init @A.%Outer.1 (%Outer.2) = converted %.loc5_15.1, %.loc5_15.2 [symbolic = %struct (constants.%struct.1)] +// CHECK:STDOUT: return %.loc5_16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @B(file.%T.loc2_13.2: type, @Outer.%U.loc3_15.2: type) { +// CHECK:STDOUT: generic fn @B(@Outer.%T.loc2: type, @Inner.%U.loc3: type) { // CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] -// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%U) [symbolic = %Outer (constants.%Outer.3)] +// CHECK:STDOUT: %Outer.1: type = class_type @Outer, @Outer(%U) [symbolic = %Outer.1 (constants.%Outer.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %struct: @B.%Outer (%Outer.3) = struct_value () [symbolic = %struct (constants.%struct.2)] +// CHECK:STDOUT: %struct: @B.%Outer.1 (%Outer.3) = struct_value () [symbolic = %struct (constants.%struct.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Inner.%return.var.loc7: @B.%Outer (%Outer.3) { +// CHECK:STDOUT: fn() -> %return: @B.%Outer.1 (%Outer.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc8_15.1: %.2 = struct_literal () -// CHECK:STDOUT: %.loc8_15.2: init @B.%Outer (%Outer.3) = class_init (), @Inner.%return.var.loc7 [symbolic = %struct (constants.%struct.2)] -// CHECK:STDOUT: %.loc8_16: init @B.%Outer (%Outer.3) = converted %.loc8_15.1, %.loc8_15.2 [symbolic = %struct (constants.%struct.2)] -// CHECK:STDOUT: return %.loc8_16 to @Inner.%return.var.loc7 +// CHECK:STDOUT: %.loc8_15.2: init @B.%Outer.1 (%Outer.3) = class_init (), %return [symbolic = %struct (constants.%struct.2)] +// CHECK:STDOUT: %.loc8_16: init @B.%Outer.1 (%Outer.3) = converted %.loc8_15.1, %.loc8_15.2 [symbolic = %struct (constants.%struct.2)] +// CHECK:STDOUT: return %.loc8_16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C(file.%T.loc2_13.2: type, @Outer.%U.loc3_15.2: type) { +// CHECK:STDOUT: generic fn @C(@Outer.%T.loc2: type, @Inner.%U.loc3: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.1)] // CHECK:STDOUT: %Inner.1: @C.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.1 (constants.%Inner.1)] @@ -691,16 +707,16 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %struct: @C.%Inner.2 (%Inner.3) = struct_value () [symbolic = %struct (constants.%struct.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Inner.%return.var.loc10: @C.%Inner.2 (%Inner.3) { +// CHECK:STDOUT: fn() -> %return: @C.%Inner.2 (%Inner.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_15.1: %.2 = struct_literal () -// CHECK:STDOUT: %.loc11_15.2: init @C.%Inner.2 (%Inner.3) = class_init (), @Inner.%return.var.loc10 [symbolic = %struct (constants.%struct.3)] +// CHECK:STDOUT: %.loc11_15.2: init @C.%Inner.2 (%Inner.3) = class_init (), %return [symbolic = %struct (constants.%struct.3)] // CHECK:STDOUT: %.loc11_16: init @C.%Inner.2 (%Inner.3) = converted %.loc11_15.1, %.loc11_15.2 [symbolic = %struct (constants.%struct.3)] -// CHECK:STDOUT: return %.loc11_16 to @Inner.%return.var.loc10 +// CHECK:STDOUT: return %.loc11_16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @D(file.%T.loc2_13.2: type, @Outer.%U.loc3_15.2: type) { +// CHECK:STDOUT: generic fn @D(@Outer.%T.loc2: type, @Inner.%U.loc3: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.1)] // CHECK:STDOUT: %Inner.1: @D.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.1 (constants.%Inner.1)] @@ -710,17 +726,17 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %struct: @D.%Inner.2 (%Inner.2) = struct_value () [symbolic = %struct (constants.%struct.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Inner.%return.var.loc13: @D.%Inner.2 (%Inner.2) { +// CHECK:STDOUT: fn() -> %return: @D.%Inner.2 (%Inner.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14_15.1: %.2 = struct_literal () -// CHECK:STDOUT: %.loc14_15.2: init @D.%Inner.2 (%Inner.2) = class_init (), @Inner.%return.var.loc13 [symbolic = %struct (constants.%struct.4)] +// CHECK:STDOUT: %.loc14_15.2: init @D.%Inner.2 (%Inner.2) = class_init (), %return [symbolic = %struct (constants.%struct.4)] // CHECK:STDOUT: %.loc14_16: init @D.%Inner.2 (%Inner.2) = converted %.loc14_15.1, %.loc14_15.2 [symbolic = %struct (constants.%struct.4)] -// CHECK:STDOUT: return %.loc14_16 to @Inner.%return.var.loc13 +// CHECK:STDOUT: return %.loc14_16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 @@ -728,7 +744,7 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%T @@ -743,16 +759,16 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@A.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Outer => constants.%Outer.2 +// CHECK:STDOUT: %Outer.1 => constants.%Outer.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%U) { -// CHECK:STDOUT: %T => constants.%U +// CHECK:STDOUT: %T.1 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2 @@ -760,16 +776,16 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@B.%U) { -// CHECK:STDOUT: %T => constants.%U +// CHECK:STDOUT: %T.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T, constants.%U) { // CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: %Outer => constants.%Outer.3 +// CHECK:STDOUT: %Outer.1 => constants.%Outer.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%T) { -// CHECK:STDOUT: %U => constants.%T +// CHECK:STDOUT: %U.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%T @@ -784,11 +800,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@C.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) { -// CHECK:STDOUT: %U => constants.%T +// CHECK:STDOUT: %U.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T, constants.%U) { @@ -799,11 +815,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@D.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T, constants.%U) { @@ -814,11 +830,11 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.2 => constants.%Inner.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@Inner.%T, @Inner.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: specific @Inner(@Inner.%T, @Inner.%U.1) { +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@Outer.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Outer(@Outer.%T.1) { +// CHECK:STDOUT: %T.1 => 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 a970c816aa7d..1b0fb52a1ef7 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -82,57 +82,67 @@ 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.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Class.ref.loc15: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] +// CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// 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.loc15: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %c.loc15_6.1: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: @F.%c: %Class.3 = bind_name c, %c.loc15_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.loc19_6.1: type = param T, runtime_param -// CHECK:STDOUT: @G.%T.loc19: type = bind_symbolic_name T 0, %T.loc19_6.1 [symbolic = @G.%T.1 (constants.%T)] -// CHECK:STDOUT: %Class.ref.loc19: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, @G.%T.loc19 [symbolic = @G.%T.1 (constants.%T)] -// CHECK:STDOUT: %Class.loc19: type = class_type @Class, @Class(constants.%T) [symbolic = @G.%Class (constants.%Class.2)] -// CHECK:STDOUT: %c.loc19_16.1: @G.%Class (%Class.2) = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: @G.%Class (%Class.2) = bind_name c, %c.loc19_16.1 -// CHECK:STDOUT: %T.ref.loc19_32: type = name_ref T, @G.%T.loc19 [symbolic = @G.%T.1 (constants.%T)] -// CHECK:STDOUT: @G.%return: ref @G.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %c.patt: @G.%Class.1 (%Class.2) = binding_pattern c +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc19: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Class.loc19: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] +// CHECK:STDOUT: %c.param: @G.%Class.1 (%Class.2) = param c, runtime_param0 +// CHECK:STDOUT: %c: @G.%Class.1 (%Class.2) = bind_name c, %c.param +// CHECK:STDOUT: %T.ref.loc19_32: type = name_ref T, %T.loc19 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @G.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %U.loc23_6.1: type = param U, runtime_param -// CHECK:STDOUT: @H.%U.loc23: type = bind_symbolic_name U 0, %U.loc23_6.1 [symbolic = @H.%U.1 (constants.%U)] -// CHECK:STDOUT: %Class.ref.loc23: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %U.ref.loc23_25: type = name_ref U, @H.%U.loc23 [symbolic = @H.%U.1 (constants.%U)] -// CHECK:STDOUT: %Class.loc23: type = class_type @Class, @Class(constants.%U) [symbolic = @H.%Class (constants.%Class.4)] -// CHECK:STDOUT: %c.loc23_16.1: @H.%Class (%Class.4) = param c, runtime_param0 -// CHECK:STDOUT: @H.%c: @H.%Class (%Class.4) = bind_name c, %c.loc23_16.1 -// CHECK:STDOUT: %U.ref.loc23_32: type = name_ref U, @H.%U.loc23 [symbolic = @H.%U.1 (constants.%U)] -// CHECK:STDOUT: @H.%return: ref @H.%U.1 (%U) = var +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 0 +// CHECK:STDOUT: %c.patt: @H.%Class.1 (%Class.4) = binding_pattern c +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc23: type = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (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 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %Class.loc23: type = class_type @Class, @Class(constants.%U) [symbolic = %Class.1 (constants.%Class.4)] +// CHECK:STDOUT: %c.param: @H.%Class.1 (%Class.4) = param c, runtime_param0 +// CHECK:STDOUT: %c: @H.%Class.1 (%Class.4) = bind_name c, %c.param +// CHECK:STDOUT: %U.ref.loc23_32: type = name_ref U, %U.loc23 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %return: ref @H.%U.1 (%U) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%.1 (%.2) = field_decl x, element0 [template] // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -155,14 +165,14 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc19: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T.1) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = unbound_element_type @G.%Class (%Class.2), @G.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @G.%Class.1 (%Class.2), @G.%T.1 (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc19: type, %c: @G.%Class (%Class.2)) -> @G.%T.1 (%T) { +// CHECK:STDOUT: fn(%T.loc19: type, %c: @G.%Class.1 (%Class.2)) -> @G.%T.1 (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: @G.%Class (%Class.2) = name_ref c, %c +// CHECK:STDOUT: %c.ref: @G.%Class.1 (%Class.2) = name_ref c, %c // CHECK:STDOUT: %x.ref: @G.%.1 (%.2) = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc20_11.1: ref @G.%T.1 (%T) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc20_11.2: @G.%T.1 (%T) = bind_value %.loc20_11.1 @@ -172,14 +182,14 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @H(%U.loc23: type) { // CHECK:STDOUT: %U.1: type = bind_symbolic_name U 0 [symbolic = %U.1 (constants.%U)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%U.1) [symbolic = %Class (constants.%Class.4)] +// CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%U.1) [symbolic = %Class.1 (constants.%Class.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = unbound_element_type @H.%Class (%Class.4), @H.%U.1 (%U) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %.1: type = unbound_element_type @H.%Class.1 (%Class.4), @H.%U.1 (%U) [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc23: type, %c: @H.%Class (%Class.4)) -> @H.%U.1 (%U) { +// CHECK:STDOUT: fn(%U.loc23: type, %c: @H.%Class.1 (%Class.4)) -> @H.%U.1 (%U) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: @H.%Class (%Class.4) = name_ref c, %c +// CHECK:STDOUT: %c.ref: @H.%Class.1 (%Class.4) = name_ref c, %c // CHECK:STDOUT: %x.ref: @H.%.1 (%.10) = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc24_11.1: ref @H.%U.1 (%U) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc24_11.2: @H.%U.1 (%U) = bind_value %.loc24_11.1 @@ -188,7 +198,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -197,12 +207,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -212,16 +222,16 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.1) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T -// CHECK:STDOUT: %Class => constants.%Class.2 +// CHECK:STDOUT: %Class.1 => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%U) { -// CHECK:STDOUT: %T => constants.%U +// CHECK:STDOUT: %T.1 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.4 @@ -231,11 +241,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.1) { -// CHECK:STDOUT: %T => constants.%U +// CHECK:STDOUT: %T.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%U) { // CHECK:STDOUT: %U.1 => constants.%U -// CHECK:STDOUT: %Class => constants.%Class.4 +// CHECK:STDOUT: %Class.1 => 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 749c4b9d0c8e..d072dcd1e6cb 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -132,48 +132,52 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CompleteClass.decl: %CompleteClass.type = class_decl @CompleteClass [template = constants.%CompleteClass.1] { -// CHECK:STDOUT: %T.loc6_21.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_21.2: type = bind_symbolic_name T 0, %T.loc6_21.1 [symbolic = @CompleteClass.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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, %CompleteClass.decl [template = constants.%CompleteClass.1] +// 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] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32, %.loc11_24.1 [template = i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] -// CHECK:STDOUT: @F.2.%return: ref %CompleteClass.3 = var +// CHECK:STDOUT: %return: ref %CompleteClass.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @CompleteClass(file.%T.loc6_21.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @CompleteClass(%T.loc6: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T.1) [symbolic = %CompleteClass (constants.%CompleteClass.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] +// CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T.1) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32.loc7, %.loc7_10.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32, %.loc7_10.1 [template = i32] // CHECK:STDOUT: %.loc7_8: @CompleteClass.%.1 (%.2) = field_decl n, element0 [template] -// CHECK:STDOUT: %F.decl: @CompleteClass.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = %F (constants.%F.1)] { -// 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] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %F.decl: @CompleteClass.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @CompleteClass.%F (constants.%F.1)] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32, %.loc8_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -186,24 +190,24 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(file.%T.loc6_21.2: type) { +// CHECK:STDOUT: generic fn @F.1(@CompleteClass.%T.loc6: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.5] -// CHECK:STDOUT: return %.loc8 +// CHECK:STDOUT: %.loc8_26: i32 = int_literal 0 [template = constants.%.5] +// CHECK:STDOUT: return %.loc8_26 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %CompleteClass.3; // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 @@ -214,12 +218,12 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- foo.impl.carbon @@ -255,9 +259,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.2 = import_ref Main//foo, inst+55, loaded [template = constants.%F.2] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -269,9 +273,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+18, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+35, unloaded +// 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.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -286,30 +290,32 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// 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: } -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { +// 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] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_24.2: type = converted %int.make_type_32, %.loc8_24.1 [template = i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] -// CHECK:STDOUT: @F.2.%return: ref %CompleteClass.3 = var +// CHECK:STDOUT: %return: ref %CompleteClass.3 = var // 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.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%.1 (%.2) = field_decl x, element0 [template] // CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -356,11 +362,11 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { @@ -418,9 +424,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+55, loaded [template = constants.%F.3] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude @@ -433,9 +439,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+18, unloaded -// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+28, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+35, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -449,17 +455,17 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UseMethod.decl: %UseMethod.type = fn_decl @UseMethod [template = constants.%UseMethod] { +// CHECK:STDOUT: %UseMethod.decl: %UseMethod.type = fn_decl @UseMethod [template = constants.%UseMethod] {} { // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: @UseMethod.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %UseField.decl: %UseField.type = fn_decl @UseField [template = constants.%UseField] { +// CHECK:STDOUT: %UseField.decl: %UseField.type = fn_decl @UseField [template = constants.%UseField] {} { // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_18.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_18.2: type = converted %int.make_type_32.loc10, %.loc10_18.1 [template = i32] -// CHECK:STDOUT: @UseField.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -485,9 +491,9 @@ class Class(U:! type) { // CHECK:STDOUT: fn @UseMethod() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32, %.loc6_23.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] +// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32.loc6, %.loc6_23.1 [template = i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var @@ -515,9 +521,9 @@ class Class(U:! type) { // CHECK:STDOUT: fn @UseField() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32, %.loc11_23.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11, %.loc11_23.1 [template = i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var @@ -608,9 +614,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+55, loaded [template = constants.%F.3] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 @@ -623,16 +629,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+18, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+35, unloaded +// 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.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type = 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.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -645,7 +651,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -805,9 +811,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+14, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+55, unloaded +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -831,8 +837,10 @@ 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.loc12_13.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc12_13.2: type = bind_symbolic_name U 0, %U.loc12_13.1 [symbolic = @.1.%U (constants.%U)] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc12: type = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -842,8 +850,8 @@ class Class(U:! type) { // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%U.loc12_13.2: type) { -// CHECK:STDOUT: %U: type = bind_symbolic_name U 0 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic class @.1(%U.loc12: type) { +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 0 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -863,6 +871,6 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %U.1 => 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 e1438aeda1b5..8204ae9944d6 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -91,42 +91,49 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [template = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.loc8_26.1: type = param T, runtime_param -// CHECK:STDOUT: @InitFromStructGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_26.1 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, @InitFromStructGeneric.%T.loc8 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc8_36.1: @InitFromStructGeneric.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @InitFromStructGeneric.%x: @InitFromStructGeneric.%T.1 (%T) = bind_name x, %x.loc8_36.1 -// CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, @InitFromStructGeneric.%T.loc8 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: @InitFromStructGeneric.%return: ref @InitFromStructGeneric.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [template = constants.%InitFromStructSpecific] { +// CHECK:STDOUT: %x.patt: i32 = binding_pattern x +// 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.loc13_27.1: i32 = param x, runtime_param0 -// CHECK:STDOUT: @InitFromStructSpecific.%x: i32 = bind_name x, %x.loc13_27.1 +// 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: @InitFromStructSpecific.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%.1 (%.2) = field_decl k, element0 [template] // CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -147,7 +154,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: fn(%T.loc8: type, %x: @InitFromStructGeneric.%T.1 (%T)) -> @InitFromStructGeneric.%T.1 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.1 (%Class.2) = var v // CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.1 (%Class.2) = bind_name v, %v.var @@ -171,9 +178,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: fn @InitFromStructSpecific(%x: 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: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32, %.loc14_15.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] +// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32.loc14, %.loc14_15.1 [template = i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] // CHECK:STDOUT: %v.var: ref %Class.3 = var v // CHECK:STDOUT: %v: ref %Class.3 = bind_name v, %v.var @@ -192,7 +199,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -201,8 +208,8 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T) { @@ -210,11 +217,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@InitFromStructGeneric.%T.1) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -266,39 +273,46 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Adapt.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromAdaptedGeneric.decl: %InitFromAdaptedGeneric.type = fn_decl @InitFromAdaptedGeneric [template = constants.%InitFromAdaptedGeneric] { -// CHECK:STDOUT: %T.loc8_27.1: type = param T, runtime_param -// CHECK:STDOUT: @InitFromAdaptedGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_27.1 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, @InitFromAdaptedGeneric.%T.loc8 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc8_37.1: @InitFromAdaptedGeneric.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @InitFromAdaptedGeneric.%x: @InitFromAdaptedGeneric.%T.1 (%T) = bind_name x, %x.loc8_37.1 -// CHECK:STDOUT: %T.ref.loc8_46: type = name_ref T, @InitFromAdaptedGeneric.%T.loc8 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: @InitFromAdaptedGeneric.%return: ref @InitFromAdaptedGeneric.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @InitFromAdaptedGeneric.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @InitFromAdaptedGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @InitFromAdaptedGeneric.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc8_46: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @InitFromAdaptedGeneric.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromAdaptedSpecific.decl: %InitFromAdaptedSpecific.type = fn_decl @InitFromAdaptedSpecific [template = constants.%InitFromAdaptedSpecific] { +// CHECK:STDOUT: %x.patt: i32 = binding_pattern x +// 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.loc12_28.1: i32 = param x, runtime_param0 -// CHECK:STDOUT: @InitFromAdaptedSpecific.%x: i32 = bind_name x, %x.loc12_28.1 +// 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: @InitFromAdaptedSpecific.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Adapt(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Adapt(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: = complete_type_witness @Adapt.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: = complete_type_witness @Adapt.%T.1 (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: adapt_decl %T // CHECK:STDOUT: %.loc6: = complete_type_witness %T [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: @@ -349,7 +363,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.2 @@ -360,11 +374,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(@InitFromAdaptedGeneric.%T.1) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.3 diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index d2cce2e15644..a467aa91045c 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -112,85 +112,97 @@ 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.loc2_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T 0, %T.loc2_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc2: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %DirectFieldAccess.decl: %DirectFieldAccess.type = fn_decl @DirectFieldAccess [template = constants.%DirectFieldAccess] { -// CHECK:STDOUT: %Class.ref.loc10: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] +// CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x +// 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.loc10: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %x.loc10_22.1: %Class.3 = param x, runtime_param0 -// CHECK:STDOUT: @DirectFieldAccess.%x: %Class.3 = bind_name x, %x.loc10_22.1 +// 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: @DirectFieldAccess.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %MethodCall.decl: %MethodCall.type = fn_decl @MethodCall [template = constants.%MethodCall] { -// CHECK:STDOUT: %Class.ref.loc14: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] +// CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x +// 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.loc14: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %x.loc14_15.1: %Class.3 = param x, runtime_param0 -// CHECK:STDOUT: @MethodCall.%x: %Class.3 = bind_name x, %x.loc14_15.1 +// 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: @MethodCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AddrMethodCall.decl: %AddrMethodCall.type = fn_decl @AddrMethodCall [template = constants.%AddrMethodCall] { -// CHECK:STDOUT: %Class.ref.loc18: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] +// CHECK:STDOUT: %p.patt: %.12 = binding_pattern p +// 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] // CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_32.loc18_28 [template = i32] // CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_28, %.loc18_27.1 [template = i32] -// CHECK:STDOUT: %Class.loc18: type = class_type @Class, @Class(i32) [template = constants.%Class.3] +// 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.loc18_19.1: %.12 = param p, runtime_param0 -// CHECK:STDOUT: @AddrMethodCall.%p: %.12 = bind_name p, %p.loc18_19.1 +// 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: @AddrMethodCall.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc2_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc2: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T) [symbolic = %Get.type (constants.%Get.type.1)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T.1) [symbolic = %Get.type (constants.%Get.type.1)] // CHECK:STDOUT: %Get: @Class.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)] -// CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T) [symbolic = %GetAddr.type (constants.%GetAddr.type.1)] +// CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T.1) [symbolic = %GetAddr.type (constants.%GetAddr.type.1)] // CHECK:STDOUT: %GetAddr: @Class.%GetAddr.type (%GetAddr.type.1) = struct_value () [symbolic = %GetAddr (constants.%GetAddr.1)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.5)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.5) [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref.loc3: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc2 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc3: @Class.%.1 (%.2) = field_decl x, element0 [template] -// CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = %Get (constants.%Get.1)] { -// CHECK:STDOUT: %.loc5: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @Get.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, %.loc5 [symbolic = @Get.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc5_10.1: @Get.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc5_10.2: @Get.%Class (%Class.2) = bind_name self, %self.loc5_10.1 -// CHECK:STDOUT: %T.ref.loc5: type = name_ref T, file.%T.loc2_13.2 [symbolic = @Get.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc5: ref @Get.%T (%T) = var +// 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: } { +// 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 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @Get.%T (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type.1) = fn_decl @GetAddr [symbolic = %GetAddr (constants.%GetAddr.1)] { -// CHECK:STDOUT: %.loc7_25: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @GetAddr.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_25 [symbolic = @GetAddr.%Class (constants.%Class.2)] -// CHECK:STDOUT: %.loc7_29: type = ptr_type %Class.2 [symbolic = @GetAddr.%.1 (constants.%.3)] -// CHECK:STDOUT: %self.loc7_19.1: @GetAddr.%.1 (%.3) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_19.3: @GetAddr.%.1 (%.3) = bind_name self, %self.loc7_19.1 -// CHECK:STDOUT: %.loc7_14: @GetAddr.%.1 (%.3) = addr_pattern %self.loc7_19.3 -// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, file.%T.loc2_13.2 [symbolic = @GetAddr.%T (constants.%T)] -// CHECK:STDOUT: %.loc7_38: type = ptr_type %T [symbolic = @GetAddr.%.2 (constants.%.4)] -// CHECK:STDOUT: %return.var.loc7: ref @GetAddr.%.2 (%.4) = var +// CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type.1) = fn_decl @GetAddr [symbolic = @Class.%GetAddr (constants.%GetAddr.1)] { +// CHECK:STDOUT: %self.patt: @GetAddr.%.1 (%.3) = binding_pattern self +// 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: type = ptr_type %Class.2 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %self.param: @GetAddr.%.1 (%.3) = param self, runtime_param0 +// CHECK:STDOUT: %self: @GetAddr.%.1 (%.3) = bind_name self, %self.param +// CHECK:STDOUT: %.loc7_14: @GetAddr.%.1 (%.3) = addr_pattern %self +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc7_38: type = ptr_type %T [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %return: ref @GetAddr.%.2 (%.4) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: @@ -202,16 +214,16 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Get(file.%T.loc2_13.2: type) { +// CHECK:STDOUT: generic fn @Get(@Class.%T.loc2: type) { // 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: !definition: // CHECK:STDOUT: %.1: type = unbound_element_type @Get.%Class (%Class.2), @Get.%T (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Class.%self.loc5_10.2: @Get.%Class (%Class.2)]() -> @Get.%T (%T) { +// CHECK:STDOUT: fn[%self: @Get.%Class (%Class.2)]() -> @Get.%T (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @Get.%Class (%Class.2) = name_ref self, @Class.%self.loc5_10.2 +// CHECK:STDOUT: %self.ref: @Get.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %x.ref: @Get.%.1 (%.2) = name_ref x, @Class.%.loc3 [template = @Class.%.loc3] // CHECK:STDOUT: %.loc5_42.1: ref @Get.%T (%T) = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc5_42.2: @Get.%T (%T) = bind_value %.loc5_42.1 @@ -219,7 +231,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GetAddr(file.%T.loc2_13.2: type) { +// CHECK:STDOUT: generic fn @GetAddr(@Class.%T.loc2: type) { // 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: %.1: type = ptr_type @GetAddr.%Class (%Class.2) [symbolic = %.1 (constants.%.3)] @@ -228,9 +240,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.3: type = unbound_element_type @GetAddr.%Class (%Class.2), @GetAddr.%T (%T) [symbolic = %.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr @Class.%self.loc7_19.3: @GetAddr.%.1 (%.3)]() -> @GetAddr.%.2 (%.4) { +// CHECK:STDOUT: fn[addr %self: @GetAddr.%.1 (%.3)]() -> @GetAddr.%.2 (%.4) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @GetAddr.%.1 (%.3) = name_ref self, @Class.%self.loc7_19.3 +// CHECK:STDOUT: %self.ref: @GetAddr.%.1 (%.3) = name_ref self, %self // CHECK:STDOUT: %.loc7_54.1: ref @GetAddr.%Class (%Class.2) = deref %self.ref // CHECK:STDOUT: %x.ref: @GetAddr.%.3 (%.2) = name_ref x, @Class.%.loc3 [template = @Class.%.loc3] // CHECK:STDOUT: %.loc7_54.2: ref @GetAddr.%T (%T) = class_element_access %.loc7_54.1, element0 @@ -279,7 +291,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -293,7 +305,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Get.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T) { @@ -302,7 +314,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetAddr.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { @@ -312,12 +324,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -388,12 +400,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -404,16 +416,20 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %StaticMemberFunctionCall.decl: %StaticMemberFunctionCall.type = fn_decl @StaticMemberFunctionCall [template = constants.%StaticMemberFunctionCall] { -// CHECK:STDOUT: %T.loc8_29.1: type = param T, runtime_param -// CHECK:STDOUT: @StaticMemberFunctionCall.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_29.1 [symbolic = @StaticMemberFunctionCall.%T.1 (constants.%T)] -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, @StaticMemberFunctionCall.%T.loc8 [symbolic = @StaticMemberFunctionCall.%T.1 (constants.%T)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%T) [symbolic = @StaticMemberFunctionCall.%Class.1 (constants.%Class.2)] -// CHECK:STDOUT: @StaticMemberFunctionCall.%return: ref @StaticMemberFunctionCall.%Class.1 (%Class.2) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Class.loc8: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] +// CHECK:STDOUT: %return: ref @StaticMemberFunctionCall.%Class.1 (%Class.2) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,19 +452,19 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T) [symbolic = %Make.type (constants.%Make.type)] +// CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.1) [symbolic = %Make.type (constants.%Make.type)] // CHECK:STDOUT: %Make: @Class.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Make.decl: @Class.%Make.type (%Make.type) = fn_decl @Make [symbolic = %Make (constants.%Make)] { +// CHECK:STDOUT: %Make.decl: @Class.%Make.type (%Make.type) = fn_decl @Make [symbolic = @Class.%Make (constants.%Make)] {} { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = @Make.%T (constants.%T)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%T) [symbolic = @Make.%Class (constants.%Class.2)] -// CHECK:STDOUT: %return.var: ref @Make.%Class (%Class.2) = var +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc4 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %Class.loc5: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] +// CHECK:STDOUT: %return: ref @Make.%Class.1 (%Class.2) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -458,19 +474,19 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(file.%T.loc4_13.2: type) { +// CHECK:STDOUT: generic fn @Make(@Class.%T.loc4: type) { // 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: %Class.1: type = class_type @Class, @Class(%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %struct: @Make.%Class (%Class.2) = struct_value () [symbolic = %struct (constants.%struct)] +// CHECK:STDOUT: %struct: @Make.%Class.1 (%Class.2) = struct_value () [symbolic = %struct (constants.%struct)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Class.%return.var: @Make.%Class (%Class.2) { +// CHECK:STDOUT: fn() -> %return: @Make.%Class.1 (%Class.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc5_35.1: %.2 = struct_literal () -// CHECK:STDOUT: %.loc5_35.2: init @Make.%Class (%Class.2) = class_init (), @Class.%return.var [symbolic = %struct (constants.%struct)] -// CHECK:STDOUT: %.loc5_36: init @Make.%Class (%Class.2) = converted %.loc5_35.1, %.loc5_35.2 [symbolic = %struct (constants.%struct)] -// CHECK:STDOUT: return %.loc5_36 to @Class.%return.var +// CHECK:STDOUT: %.loc5_35.2: init @Make.%Class.1 (%Class.2) = class_init (), %return [symbolic = %struct (constants.%struct)] +// CHECK:STDOUT: %.loc5_36: init @Make.%Class.1 (%Class.2) = converted %.loc5_35.1, %.loc5_35.2 [symbolic = %struct (constants.%struct)] +// CHECK:STDOUT: return %.loc5_36 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -488,8 +504,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.loc8: type) -> %return: @StaticMemberFunctionCall.%Class.1 (%Class.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// 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 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %Class.loc15: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: %.loc15_18: @StaticMemberFunctionCall.%Make.type (%Make.type) = specific_constant @Class.%Make.decl, @Class(constants.%T) [symbolic = %Make (constants.%Make)] // CHECK:STDOUT: %Make.ref: @StaticMemberFunctionCall.%Make.type (%Make.type) = name_ref Make, %.loc15_18 [symbolic = %Make (constants.%Make)] @@ -513,7 +529,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type @@ -521,20 +537,20 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Make.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class => constants.%Class.2 +// CHECK:STDOUT: %Class.1 => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.1) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @StaticMemberFunctionCall(constants.%T) { diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index a4ff752cdc11..9043cb3729bc 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -76,41 +76,47 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] -// CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T) [symbolic = %G.type (constants.%G.type)] +// CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T.1) [symbolic = %G.type (constants.%G.type)] // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, file.%T.loc4_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %n.loc5_8.1: @F.%T (%T) = param n, runtime_param0 -// CHECK:STDOUT: %n.loc5_8.2: @F.%T (%T) = bind_name n, %n.loc5_8.1 -// CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, file.%T.loc4_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc5: ref @F.%T (%T) = var +// 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: } { +// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4 [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 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @F.%T (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: @Class.%G.type (%G.type) = fn_decl @G [symbolic = %G (constants.%G)] { -// CHECK:STDOUT: %.loc9: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @G.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9 [symbolic = @G.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc9_8.1: @G.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc9_8.2: @G.%Class (%Class.2) = bind_name self, %self.loc9_8.1 -// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, file.%T.loc4_13.2 [symbolic = @G.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc9: ref @G.%T (%T) = var +// 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: } { +// 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 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @G.%T (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc13: @Class.%.1 (%.2) = field_decl n, element0 [template] // CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -122,28 +128,28 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_13.2: type) { +// CHECK:STDOUT: generic fn @F(@Class.%T.loc4: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Class.%n.loc5_8.2: @F.%T (%T)) -> @F.%T (%T) { +// CHECK:STDOUT: fn(%n: @F.%T (%T)) -> @F.%T (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: @F.%T (%T) = name_ref n, @Class.%n.loc5_8.2 +// CHECK:STDOUT: %n.ref: @F.%T (%T) = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(file.%T.loc4_13.2: type) { +// CHECK:STDOUT: generic fn @G(@Class.%T.loc4: type) { // 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: !definition: // CHECK:STDOUT: %.1: type = unbound_element_type @G.%Class (%Class.2), @G.%T (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Class.%self.loc9_8.2: @G.%Class (%Class.2)]() -> @G.%T (%T) { +// CHECK:STDOUT: fn[%self: @G.%Class (%Class.2)]() -> @G.%T (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, @Class.%self.loc9_8.2 +// CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %n.ref: @G.%.1 (%.2) = name_ref n, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc10_16.1: ref @G.%T (%T) = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc10_16.2: @G.%T (%T) = bind_value %.loc10_16.1 @@ -152,7 +158,7 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -170,7 +176,7 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { @@ -178,8 +184,8 @@ class C(T:! type) { // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_member_inline.carbon @@ -218,22 +224,24 @@ 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.loc4_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @C.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%T.loc4_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F, @C(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @C(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @C.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] -// CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.2)] +// CHECK:STDOUT: %C: type = class_type @C, @C(%T.1) [symbolic = %C (constants.%C.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @C.%C (%C.2), %.2 [symbolic = %.1 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] {} +// CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = @C.%F (constants.%F)] {} {} // CHECK:STDOUT: %.loc11_14.1: %.2 = struct_literal () // CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %.loc11_11: @C.%.1 (%.3) = field_decl data, element0 [template] @@ -246,7 +254,7 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_9.2: type) { +// CHECK:STDOUT: generic fn @F(@C.%T.loc4: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.2)] @@ -260,7 +268,7 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -271,11 +279,11 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@C.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @C(@C.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@F.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => 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 a4ea4862ea9c..7d7fa05bd031 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -143,60 +143,70 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { -// CHECK:STDOUT: %T.loc10_10.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_10.2: type = bind_symbolic_name T 0, %T.loc10_10.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10_10.2 [symbolic = constants.%T] -// CHECK:STDOUT: %n.loc10_22.1: %T = param n, runtime_param0 -// CHECK:STDOUT: @F.%n: %T = bind_name n, %n.loc10_22.1 -// CHECK:STDOUT: %T.ref.loc10_31: type = name_ref T, %T.loc10_10.2 [symbolic = constants.%T] -// CHECK:STDOUT: @F.%return: ref %T = var +// CHECK:STDOUT: %n.patt: %T = binding_pattern n +// 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: %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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [symbolic = constants.%G] { -// CHECK:STDOUT: %T.loc14_10.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc14_10.2: type = bind_symbolic_name T 0, %T.loc14_10.1 [symbolic = constants.%T] +// CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// 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: %.loc14: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = constants.%Class.2] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc14 [symbolic = constants.%Class.2] -// CHECK:STDOUT: %self.loc14_22.1: %Class.2 = param self, runtime_param0 -// CHECK:STDOUT: @G.%self: %Class.2 = bind_name self, %self.loc14_22.1 -// CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T.loc14_10.2 [symbolic = constants.%T] -// CHECK:STDOUT: @G.%return: ref %T = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] -// CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T) [symbolic = %G.type (constants.%G.type)] +// CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T.1) [symbolic = %G.type (constants.%G.type)] // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, file.%T.loc4_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %n.loc5_8.1: @F.%T (%T) = param n, runtime_param0 -// CHECK:STDOUT: %n.loc5_8.2: @F.%T (%T) = bind_name n, %n.loc5_8.1 -// CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, file.%T.loc4_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc5: ref @F.%T (%T) = var +// 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: } { +// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %n.param.loc5: @F.%T.1 (%T) = param n, runtime_param0 +// CHECK:STDOUT: %n.loc5: @F.%T.1 (%T) = bind_name n, %n.param.loc5 +// CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, @Class.%T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return.var.loc5: ref @F.%T.1 (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: @Class.%G.type (%G.type) = fn_decl @G [symbolic = %G (constants.%G)] { -// CHECK:STDOUT: %.loc6: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @G.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6 [symbolic = @G.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc6_8.1: @G.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc6_8.2: @G.%Class (%Class.2) = bind_name self, %self.loc6_8.1 -// CHECK:STDOUT: %T.ref.loc6: type = name_ref T, file.%T.loc4_13.2 [symbolic = @G.%T (constants.%T)] -// CHECK:STDOUT: %return.var.loc6: ref @G.%T (%T) = var +// 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: } { +// 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 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return.var.loc6: ref @G.%T.1 (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc7: @Class.%.1 (%.2) = field_decl n, element0 [template] // CHECK:STDOUT: %.loc8: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -208,37 +218,37 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic fn @F(@Class.%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n: %T) -> %T { +// CHECK:STDOUT: fn(%n.loc10: %T) -> %T { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: @F.%T (%T) = name_ref n, %n +// CHECK:STDOUT: %n.ref: @F.%T.1 (%T) = name_ref n, %n.loc10 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(file.%T.loc4_13.2: type) { -// 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: generic fn @G(@Class.%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = unbound_element_type @G.%Class (%Class.2), @G.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @G.%Class (%Class.2), @G.%T.1 (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: %Class.2]() -> %T { +// CHECK:STDOUT: fn[%self.loc14: %Class.2]() -> %T { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, %self +// CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, %self.loc14 // CHECK:STDOUT: %n.ref: @G.%.1 (%.2) = name_ref n, @Class.%.loc7 [template = @Class.%.loc7] -// CHECK:STDOUT: %.loc15_14.1: ref @G.%T (%T) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc15_14.2: @G.%T (%T) = bind_value %.loc15_14.1 +// CHECK:STDOUT: %.loc15_14.1: ref @G.%T.1 (%T) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc15_14.2: @G.%T.1 (%T) = bind_value %.loc15_14.1 // CHECK:STDOUT: return %.loc15_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -252,20 +262,20 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@G.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nested.carbon @@ -307,37 +317,44 @@ 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.loc4_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @A.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { -// CHECK:STDOUT: %T.loc10_6.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc10_22: type = name_ref T, %T.loc10_6.2 [symbolic = constants.%T] -// CHECK:STDOUT: %N.loc10_18.1: %T = param N, runtime_param -// CHECK:STDOUT: %N.loc10_18.2: %T = bind_symbolic_name N 1, %N.loc10_18.1 [symbolic = constants.%N] +// CHECK:STDOUT: %self.patt: %B.2 = binding_pattern self +// CHECK:STDOUT: %a.patt: %T = binding_pattern a +// 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: %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: %.loc10: type = specific_constant constants.%B.2, @B(constants.%T, constants.%N) [symbolic = constants.%B.2] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10 [symbolic = constants.%B.2] -// CHECK:STDOUT: %self.loc10_27.1: %B.2 = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %B.2 = bind_name self, %self.loc10_27.1 -// CHECK:STDOUT: %T.ref.loc10_42: type = name_ref T, %T.loc10_6.2 [symbolic = constants.%T] -// CHECK:STDOUT: %a.loc10_39.1: %T = param a, runtime_param1 -// CHECK:STDOUT: @F.%a: %T = bind_name a, %a.loc10_39.1 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @A(file.%T.loc4_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @A(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T) [symbolic = %B.type (constants.%B.type)] +// CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T.1) [symbolic = %B.type (constants.%B.type)] // CHECK:STDOUT: %B: @A.%B.type (%B.type) = struct_value () [symbolic = %B (constants.%B.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %B.decl: @A.%B.type (%B.type) = class_decl @B [symbolic = %B (constants.%B.1)] { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_9.2 [symbolic = @B.%T (constants.%T)] -// CHECK:STDOUT: %N.loc5_11.1: @B.%T (%T) = param N, runtime_param -// CHECK:STDOUT: %N.loc5_11.2: @B.%T (%T) = bind_symbolic_name N 1, %N.loc5_11.1 [symbolic = @B.%N (constants.%N)] +// 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: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc4 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %N.param: @B.%T (%T) = param N, runtime_param +// CHECK:STDOUT: %N.loc5: @B.%T (%T) = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -347,23 +364,26 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B(file.%T.loc4_9.2: type, @A.%N.loc5_11.2: @B.%T (%T)) { +// CHECK:STDOUT: generic class @B(@A.%T.loc4: type, %N.loc5: @B.%T (%T)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: %T = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.1: %T = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F, @B(%T, %N) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @B(%T, %N.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @B.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %F.decl: @B.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %.loc6: type = specific_constant constants.%B.2, @B(constants.%T, constants.%N) [symbolic = @F.%B (constants.%B.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6 [symbolic = @F.%B (constants.%B.2)] -// CHECK:STDOUT: %self.loc6_10.1: @F.%B (%B.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc6_10.2: @F.%B (%B.2) = bind_name self, %self.loc6_10.1 -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_9.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %a.loc6_22.1: @F.%T (%T) = param a, runtime_param1 -// CHECK:STDOUT: %a.loc6_22.2: @F.%T (%T) = bind_name a, %a.loc6_22.1 +// 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: %a.patt: %T = binding_pattern a +// 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 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %a.param.loc6: @F.%T.1 (%T) = param a, runtime_param1 +// CHECK:STDOUT: %a.loc6: @F.%T.1 (%T) = bind_name a, %a.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -373,21 +393,21 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_9.2: type, @A.%N.loc5_11.2: @B.%T (%T)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: %T = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %B: type = class_type @B, @B(%T, %N) [symbolic = %B (constants.%B.2)] +// CHECK:STDOUT: generic fn @F(@A.%T.loc4: type, @B.%N.loc5: @B.%T (%T)) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: %T = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] +// CHECK:STDOUT: %B: type = class_type @B, @B(%T.1, %N.1) [symbolic = %B (constants.%B.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: %B.2](%a: %T) { +// CHECK:STDOUT: fn[%self.loc10: %B.2](%a.loc10: %T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %B.type => constants.%B.type @@ -396,31 +416,31 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T, constants.%N) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(@F.%T, @F.%N) { +// CHECK:STDOUT: specific @B(@F.%T.1, @F.%N.1) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: %B => constants.%B.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(@B.%T, @B.%N) { +// CHECK:STDOUT: specific @B(@B.%T, @B.%N.1) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@A.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @A(@A.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_not_generic_vs_generic.carbon @@ -456,15 +476,15 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: .NotGeneric = %NotGeneric.decl // CHECK:STDOUT: } // 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.loc15_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_15.2: type = bind_symbolic_name T 0, %T.loc15_15.1 [symbolic = @.1.%T (constants.%T)] +// 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: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NotGeneric { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -474,8 +494,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%T.loc15_15.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic fn @.1(%T.loc15: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -486,7 +506,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_too_few_args.carbon @@ -525,21 +545,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.loc4_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Generic(file.%T.loc4_15.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Generic(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew, @Generic(%T) [symbolic = %TooFew.type (constants.%TooFew.type)] +// CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew, @Generic(%T.1) [symbolic = %TooFew.type (constants.%TooFew.type)] // CHECK:STDOUT: %TooFew: @Generic.%TooFew.type (%TooFew.type) = struct_value () [symbolic = %TooFew (constants.%TooFew)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %TooFew.decl: @Generic.%TooFew.type (%TooFew.type) = fn_decl @TooFew [symbolic = %TooFew (constants.%TooFew)] {} +// CHECK:STDOUT: %TooFew.decl: @Generic.%TooFew.type (%TooFew.type) = fn_decl @TooFew [symbolic = @Generic.%TooFew (constants.%TooFew)] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -548,7 +570,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TooFew(file.%T.loc4_15.2: type) { +// CHECK:STDOUT: generic fn @TooFew(@Generic.%T.loc4: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } @@ -559,13 +581,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TooFew(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(@Generic.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Generic(@Generic.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_too_many_args.carbon @@ -605,26 +627,28 @@ 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.loc4_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %T.loc15_12.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_12.2: type = bind_symbolic_name T 0, %T.loc15_12.1 [symbolic = @.1.%T (constants.%T)] -// CHECK:STDOUT: %U.loc15_22.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc15_22.2: type = bind_symbolic_name U 1, %U.loc15_22.1 [symbolic = @.1.%U (constants.%U)] +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc15: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc15: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Generic(file.%T.loc4_15.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Generic(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany, @Generic(%T) [symbolic = %TooMany.type (constants.%TooMany.type)] +// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany, @Generic(%T.1) [symbolic = %TooMany.type (constants.%TooMany.type)] // CHECK:STDOUT: %TooMany: @Generic.%TooMany.type (%TooMany.type) = struct_value () [symbolic = %TooMany (constants.%TooMany)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %TooMany.decl: @Generic.%TooMany.type (%TooMany.type) = fn_decl @TooMany [symbolic = %TooMany (constants.%TooMany)] {} +// CHECK:STDOUT: %TooMany.decl: @Generic.%TooMany.type (%TooMany.type) = fn_decl @TooMany [symbolic = @Generic.%TooMany (constants.%TooMany)] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -633,14 +657,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TooMany(file.%T.loc4_15.2: type) { +// CHECK:STDOUT: generic fn @TooMany(@Generic.%T.loc4: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%T.loc15_12.2: type, file.%U.loc15_22.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic fn @.1(%T.loc15: type, %U.loc15: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -651,18 +675,18 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TooMany(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(@Generic.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Generic(@Generic.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_wrong_arg_type.carbon @@ -702,26 +726,28 @@ 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.loc4_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { +// 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.loc14_12.1: %.1 = param T, runtime_param -// CHECK:STDOUT: %T.loc14_12.2: %.1 = bind_symbolic_name T 0, %T.loc14_12.1 [symbolic = @.1.%T (constants.%T.2)] +// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param +// CHECK:STDOUT: %T.loc14: %.1 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Generic(file.%T.loc4_15.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic class @Generic(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %WrongType.type: type = fn_type @WrongType, @Generic(%T) [symbolic = %WrongType.type (constants.%WrongType.type)] +// CHECK:STDOUT: %WrongType.type: type = fn_type @WrongType, @Generic(%T.1) [symbolic = %WrongType.type (constants.%WrongType.type)] // CHECK:STDOUT: %WrongType: @Generic.%WrongType.type (%WrongType.type) = struct_value () [symbolic = %WrongType (constants.%WrongType)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %WrongType.decl: @Generic.%WrongType.type (%WrongType.type) = fn_decl @WrongType [symbolic = %WrongType (constants.%WrongType)] {} +// CHECK:STDOUT: %WrongType.decl: @Generic.%WrongType.type (%WrongType.type) = fn_decl @WrongType [symbolic = @Generic.%WrongType (constants.%WrongType)] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -730,13 +756,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @WrongType(file.%T.loc4_15.2: type) { +// CHECK:STDOUT: generic fn @WrongType(@Generic.%T.loc4: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%T.loc14_12.2: %.1) { -// CHECK:STDOUT: %T: %.1 = bind_symbolic_name T 0 [symbolic = %T (constants.%T.2)] +// CHECK:STDOUT: generic fn @.1(%T.loc14: %.1) { +// CHECK:STDOUT: %T.1: %.1 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -747,16 +773,16 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongType(constants.%T.1) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(@Generic.%T) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: specific @Generic(@Generic.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.2) { -// CHECK:STDOUT: %T => constants.%T.2 +// CHECK:STDOUT: %T.1 => 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 209d46299e78..89ec25446294 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -82,35 +82,41 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: .CallGenericMethodWithNonDeducedParam = %CallGenericMethodWithNonDeducedParam.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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.loc14_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc14_13.2: type = bind_symbolic_name T 0, %T.loc14_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc14: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [template = constants.%CallGenericMethod] { -// CHECK:STDOUT: %Class.ref.loc19: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %A.ref.loc19_31: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %Class.loc19: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.3] -// CHECK:STDOUT: %c.loc19_22.1: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: @CallGenericMethod.%c: %Class.3 = bind_name c, %c.loc19_22.1 -// CHECK:STDOUT: %A.ref.loc19_39: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %B.ref.loc19: type = name_ref B, %B.decl [template = constants.%B] +// CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// 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.%.6 [template = constants.%.6] -// CHECK:STDOUT: @CallGenericMethod.%return: ref %.6 = var +// CHECK:STDOUT: %return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam.decl: %CallGenericMethodWithNonDeducedParam.type = fn_decl @CallGenericMethodWithNonDeducedParam [template = constants.%CallGenericMethodWithNonDeducedParam] { -// CHECK:STDOUT: %Class.ref.loc23: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %A.ref.loc23_50: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %Class.loc23: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.3] -// CHECK:STDOUT: %c.loc23_41.1: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: @CallGenericMethodWithNonDeducedParam.%c: %Class.3 = bind_name c, %c.loc23_41.1 -// CHECK:STDOUT: %A.ref.loc23_58: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %B.ref.loc23: type = name_ref B, %B.decl [template = constants.%B] +// CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// 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.%.6 [template = constants.%.6] -// CHECK:STDOUT: @CallGenericMethodWithNonDeducedParam.%return: ref %.6 = var +// CHECK:STDOUT: %return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -128,36 +134,41 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc14_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc14: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // 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.type: type = fn_type @Get, @Class(%T.1) [symbolic = %Get.type (constants.%Get.type.1)] // CHECK:STDOUT: %Get: @Class.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)] -// CHECK:STDOUT: %GetNoDeduce.type: type = fn_type @GetNoDeduce, @Class(%T) [symbolic = %GetNoDeduce.type (constants.%GetNoDeduce.type.1)] +// CHECK:STDOUT: %GetNoDeduce.type: type = fn_type @GetNoDeduce, @Class(%T.1) [symbolic = %GetNoDeduce.type (constants.%GetNoDeduce.type.1)] // CHECK:STDOUT: %GetNoDeduce: @Class.%GetNoDeduce.type (%GetNoDeduce.type.1) = struct_value () [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = %Get (constants.%Get.1)] { -// CHECK:STDOUT: %U.loc15_10.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc15_10.2: type = bind_symbolic_name U 1, %U.loc15_10.1 [symbolic = @Get.%U.1 (constants.%U)] -// CHECK:STDOUT: %T.ref.loc15: type = name_ref T, file.%T.loc14_13.2 [symbolic = @Get.%T (constants.%T)] -// CHECK:STDOUT: %U.ref.loc15: type = name_ref U, %U.loc15_10.2 [symbolic = @Get.%U.1 (constants.%U)] -// CHECK:STDOUT: %.loc15_28.1: %.4 = tuple_literal (%T.ref.loc15, %U.ref.loc15) -// CHECK:STDOUT: %.loc15_28.2: type = converted %.loc15_28.1, constants.%.5 [symbolic = @Get.%.1 (constants.%.5)] -// CHECK:STDOUT: %return.var.loc15: ref @Get.%.1 (%.5) = var +// 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: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc15: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc14 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc15 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %.loc15_28.1: %.4 = tuple_literal (%T.ref, %U.ref) +// CHECK:STDOUT: %.loc15_28.2: type = converted %.loc15_28.1, constants.%.5 [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %return: ref @Get.%.1 (%.5) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %GetNoDeduce.decl: @Class.%GetNoDeduce.type (%GetNoDeduce.type.1) = fn_decl @GetNoDeduce [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] { -// CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, file.%T.loc14_13.2 [symbolic = @GetNoDeduce.%T (constants.%T)] -// CHECK:STDOUT: %x.loc16_18.1: @GetNoDeduce.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc16_18.2: @GetNoDeduce.%T (%T) = bind_name x, %x.loc16_18.1 -// CHECK:STDOUT: %U.loc16_24.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc16_24.2: type = bind_symbolic_name U 1, %U.loc16_24.1 [symbolic = @GetNoDeduce.%U.1 (constants.%U)] -// CHECK:STDOUT: %T.ref.loc16_38: type = name_ref T, file.%T.loc14_13.2 [symbolic = @GetNoDeduce.%T (constants.%T)] -// CHECK:STDOUT: %U.ref.loc16: type = name_ref U, %U.loc16_24.2 [symbolic = @GetNoDeduce.%U.1 (constants.%U)] -// CHECK:STDOUT: %.loc16_42.1: %.4 = tuple_literal (%T.ref.loc16_38, %U.ref.loc16) -// CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%.5 [symbolic = @GetNoDeduce.%.1 (constants.%.5)] -// CHECK:STDOUT: %return.var.loc16: ref @GetNoDeduce.%.1 (%.5) = var +// 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: } { +// CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, @Class.%T.loc14 [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: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %T.ref.loc16_38: type = name_ref T, @Class.%T.loc14 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc16 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %.loc16_42.1: %.4 = tuple_literal (%T.ref.loc16_38, %U.ref) +// CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%.5 [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %return: ref @GetNoDeduce.%.1 (%.5) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -168,20 +179,20 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Get(file.%T.loc14_13.2: type, @Class.%U.loc15_10.2: type) { +// CHECK:STDOUT: generic fn @Get(@Class.%T.loc14: type, %U.loc15: type) { // CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.1: type = tuple_type (@Get.%T (%T), @Get.%U.1 (%U)) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Class.%U.loc15_10.2: type) -> @Get.%.1 (%.5); +// CHECK:STDOUT: fn(%U.loc15: type) -> @Get.%.1 (%.5); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GetNoDeduce(file.%T.loc14_13.2: type, @Class.%U.loc16_24.2: type) { +// CHECK:STDOUT: generic fn @GetNoDeduce(@Class.%T.loc14: type, %U.loc16: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: %.1: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.1 (%U)) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Class.%x.loc16_18.2: @GetNoDeduce.%T (%T), @Class.%U.loc16_24.2: type) -> @GetNoDeduce.%.1 (%.5); +// CHECK:STDOUT: fn(%x: @GetNoDeduce.%T (%T), %U.loc16: type) -> @GetNoDeduce.%.1 (%.5); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallGenericMethod(%c: %Class.3) -> %return: %.6 { @@ -189,9 +200,9 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %.loc20: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(constants.%A) [template = constants.%Get.2] // CHECK:STDOUT: %Get.ref: %Get.type.2 = name_ref Get, %.loc20 [template = constants.%Get.2] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc19: ref %.6 = splice_block %return {} -// CHECK:STDOUT: %Get.call: init %.6 = call %Get.ref() to %.loc19 +// CHECK:STDOUT: %B.ref.loc20: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc19_35: ref %.6 = splice_block %return {} +// CHECK:STDOUT: %Get.call: init %.6 = call %Get.ref() to %.loc19_35 // CHECK:STDOUT: return %Get.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -201,19 +212,19 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc24_11: %GetNoDeduce.type.2 = specific_constant @Class.%GetNoDeduce.decl, @Class(constants.%A) [template = constants.%GetNoDeduce.2] // CHECK:STDOUT: %GetNoDeduce.ref: %GetNoDeduce.type.2 = name_ref GetNoDeduce, %.loc24_11 [template = constants.%GetNoDeduce.2] // CHECK:STDOUT: %.loc24_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc23: ref %.6 = splice_block %return {} +// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc23_54: ref %.6 = splice_block %return {} // 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 %.6 = call %GetNoDeduce.ref(%.loc24_23.2) to %.loc23 +// CHECK:STDOUT: %GetNoDeduce.call: init %.6 = call %GetNoDeduce.ref(%.loc24_23.2) to %.loc23_54 // CHECK:STDOUT: return %GetNoDeduce.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T, constants.%U) { @@ -228,12 +239,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%A) { -// CHECK:STDOUT: %T => constants.%A +// CHECK:STDOUT: %T.1 => constants.%A // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Get.type => constants.%Get.type.2 diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 582d409145f8..9f52cb639d85 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -118,17 +118,21 @@ 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.loc4_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param.loc4: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl.loc6: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.loc6_15.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_15.2: type = bind_symbolic_name T 0, %T.loc6_15.1 [symbolic = constants.%T] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Generic(file.%T.loc4_15.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Generic(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -141,7 +145,7 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_list.carbon @@ -176,17 +180,19 @@ class E(U:! type) {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.loc12_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T 0, %T.loc12_9.1 [symbolic = @.1.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A; // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%T.loc12_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @.1(%T.loc12: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -199,7 +205,7 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_implicit_param_list.carbon @@ -243,30 +249,35 @@ 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: } { // 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.loc4_9.1: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_9.2: i32 = bind_symbolic_name N 0, %N.loc4_9.1 [symbolic = @B.%N (constants.%N.1)] +// CHECK:STDOUT: %N.param: i32 = param N, runtime_param +// CHECK:STDOUT: %N.loc4: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.loc12_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T 0, %T.loc12_9.1 [symbolic = @.1.%T (constants.%T)] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.2 [symbolic = @.1.%T (constants.%T)] -// CHECK:STDOUT: %N.loc12_19.1: @.1.%T (%T) = param N, runtime_param -// CHECK:STDOUT: %N.loc12_19.2: @.1.%T (%T) = bind_symbolic_name N 1, %N.loc12_19.1 [symbolic = @.1.%N (constants.%N.2)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: @.1.%T.1 (%T) = symbolic_binding_pattern N 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.param: @.1.%T.1 (%T) = param N, runtime_param +// CHECK:STDOUT: %N.loc12: @.1.%T.1 (%T) = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B(file.%N.loc4_9.2: i32) { -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 0 [symbolic = %N (constants.%N.1)] +// CHECK:STDOUT: generic class @B(%N.loc4: i32) { +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N 0 [symbolic = %N.1 (constants.%N.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%T.loc12_9.2: type, file.%N.loc12_19.2: @.1.%T (%T)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N: %T = bind_symbolic_name N 1 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: generic class @.1(%T.loc12: type, %N.loc12: @.1.%T.1 (%T)) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %N.1: %T = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -281,12 +292,12 @@ class E(U:! type) {} // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%N.1) { -// CHECK:STDOUT: %N => constants.%N.1 +// CHECK:STDOUT: %N.1 => constants.%N.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%N.2) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %N.1 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_count.carbon @@ -329,34 +340,39 @@ 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.loc4_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @C.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.loc12_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T 0, %T.loc12_9.1 [symbolic = @.1.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: i32 = symbolic_binding_pattern U 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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.loc12_19.1: i32 = param U, runtime_param -// CHECK:STDOUT: %U.loc12_19.2: i32 = bind_symbolic_name U 1, %U.loc12_19.1 [symbolic = @.1.%U (constants.%U)] +// CHECK:STDOUT: %U.param: i32 = param U, runtime_param +// CHECK:STDOUT: %U.loc12: i32 = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%T.loc4_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%T.loc12_9.2: type, file.%U.loc12_19.2: i32) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %U: i32 = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic class @.1(%T.loc12: type, %U.loc12: i32) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.1: i32 = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_29: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 @@ -366,12 +382,12 @@ class E(U:! type) {} // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_type.carbon @@ -414,31 +430,35 @@ 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.loc4_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @D.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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: } { // 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.loc12_9.1: i32 = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.2: i32 = bind_symbolic_name T 0, %T.loc12_9.1 [symbolic = @.1.%T (constants.%T.2)] +// CHECK:STDOUT: %T.param: i32 = param T, runtime_param +// CHECK:STDOUT: %T.loc12: i32 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D(file.%T.loc4_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic class @D(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%T.loc12_9.2: i32) { -// CHECK:STDOUT: %T: i32 = bind_symbolic_name T 0 [symbolic = %T (constants.%T.2)] +// CHECK:STDOUT: generic class @.1(%T.loc12: i32) { +// CHECK:STDOUT: %T.1: i32 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_19: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 @@ -448,11 +468,11 @@ class E(U:! type) {} // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.2) { -// CHECK:STDOUT: %T => constants.%T.2 +// CHECK:STDOUT: %T.1 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_name.carbon @@ -491,23 +511,27 @@ 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.loc4_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @E.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %U.loc11_9.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_9.2: type = bind_symbolic_name U 0, %U.loc11_9.1 [symbolic = @.1.%U (constants.%U)] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc11: type = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @E(file.%T.loc4_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @E(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%U.loc11_9.2: type) { -// CHECK:STDOUT: %U: type = bind_symbolic_name U 0 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic class @.1(%U.loc11: type) { +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 0 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -520,10 +544,10 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @E(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %U.1 => 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 f9206a55107c..4c0922848c33 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -58,35 +58,37 @@ 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.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MakeSelf.type: type = fn_type @MakeSelf, @Class(%T) [symbolic = %MakeSelf.type (constants.%MakeSelf.type)] +// CHECK:STDOUT: %MakeSelf.type: type = fn_type @MakeSelf, @Class(%T.1) [symbolic = %MakeSelf.type (constants.%MakeSelf.type)] // CHECK:STDOUT: %MakeSelf: @Class.%MakeSelf.type (%MakeSelf.type) = struct_value () [symbolic = %MakeSelf (constants.%MakeSelf)] -// CHECK:STDOUT: %MakeClass.type: type = fn_type @MakeClass, @Class(%T) [symbolic = %MakeClass.type (constants.%MakeClass.type)] +// CHECK:STDOUT: %MakeClass.type: type = fn_type @MakeClass, @Class(%T.1) [symbolic = %MakeClass.type (constants.%MakeClass.type)] // CHECK:STDOUT: %MakeClass: @Class.%MakeClass.type (%MakeClass.type) = struct_value () [symbolic = %MakeClass (constants.%MakeClass)] -// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %MakeSelf.decl: @Class.%MakeSelf.type (%MakeSelf.type) = fn_decl @MakeSelf [symbolic = %MakeSelf (constants.%MakeSelf)] { -// CHECK:STDOUT: %.loc14: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @MakeSelf.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc14 [symbolic = @MakeSelf.%Class (constants.%Class.2)] -// CHECK:STDOUT: %return.var.loc14: ref @MakeSelf.%Class (%Class.2) = var +// CHECK:STDOUT: %MakeSelf.decl: @Class.%MakeSelf.type (%MakeSelf.type) = fn_decl @MakeSelf [symbolic = @Class.%MakeSelf (constants.%MakeSelf)] {} { +// CHECK:STDOUT: %.loc14: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc14 [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %return: ref @MakeSelf.%Class (%Class.2) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %MakeClass.decl: @Class.%MakeClass.type (%MakeClass.type) = fn_decl @MakeClass [symbolic = %MakeClass (constants.%MakeClass)] { +// CHECK:STDOUT: %MakeClass.decl: @Class.%MakeClass.type (%MakeClass.type) = fn_decl @MakeClass [symbolic = @Class.%MakeClass (constants.%MakeClass)] {} { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = @MakeClass.%T (constants.%T)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%T) [symbolic = @MakeClass.%Class (constants.%Class.2)] -// CHECK:STDOUT: %return.var.loc15: ref @MakeClass.%Class (%Class.2) = var +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %Class.loc15: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] +// CHECK:STDOUT: %return: ref @MakeClass.%Class.1 (%Class.2) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] {} +// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] {} {} // CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -97,21 +99,21 @@ class Class(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MakeSelf(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @MakeSelf(@Class.%T.loc11: type) { // 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() -> @MakeSelf.%Class (%Class.2); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MakeClass(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @MakeClass(@Class.%T.loc11: type) { // 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: %Class.1: type = class_type @Class, @Class(%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @MakeClass.%Class (%Class.2); +// CHECK:STDOUT: fn() -> @MakeClass.%Class.1 (%Class.2); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc11_13.2: type) { +// CHECK:STDOUT: generic fn @F(@Class.%T.loc11: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T) [symbolic = %Class.1 (constants.%Class.2)] @@ -123,7 +125,7 @@ class Class(T:! type) { // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Class.loc17: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: %c.var: ref @F.%Class.1 (%Class.2) = var c // CHECK:STDOUT: %c: ref @F.%Class.1 (%Class.2) = bind_name c, %c.var @@ -146,7 +148,7 @@ class Class(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %MakeSelf.type => constants.%MakeSelf.type @@ -158,7 +160,7 @@ class Class(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@MakeSelf.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeSelf(constants.%T) { @@ -167,21 +169,21 @@ class Class(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@MakeClass.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class => constants.%Class.2 +// CHECK:STDOUT: %Class.1 => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index a36a5162adec..a570d151a611 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -51,44 +51,52 @@ 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.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { -// CHECK:STDOUT: %T.loc16_10.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc16_10.2: type = bind_symbolic_name T 0, %T.loc16_10.1 [symbolic = constants.%T] +// CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// CHECK:STDOUT: %n.patt: %T = binding_pattern n +// 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: %.loc16: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = constants.%Class.2] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc16 [symbolic = constants.%Class.2] -// CHECK:STDOUT: %self.loc16_22.1: %Class.2 = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %Class.2 = bind_name self, %self.loc16_22.1 -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc16_10.2 [symbolic = constants.%T] -// CHECK:STDOUT: %n.loc16_34.1: %T = param n, runtime_param1 -// CHECK:STDOUT: @F.%n: %T = bind_name n, %n.loc16_34.1 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Class(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] -// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T.1 (%T)} [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%.1 (%.2) = field_decl a, element0 [template] -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @F.%Class (constants.%Class.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = @F.%Class (constants.%Class.2)] -// CHECK:STDOUT: %self.loc13_8.1: @F.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8.2: @F.%Class (%Class.2) = bind_name self, %self.loc13_8.1 -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, file.%T.loc11_13.2 [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %n.loc13_20.1: @F.%T (%T) = param n, runtime_param1 -// CHECK:STDOUT: %n.loc13_20.2: @F.%T (%T) = bind_name n, %n.loc13_20.1 +// 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: %n.patt: %T = binding_pattern n +// 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 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %n.param.loc13: @F.%T.1 (%T) = param n, runtime_param1 +// CHECK:STDOUT: %n.loc13: @F.%T.1 (%T) = bind_name n, %n.param.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -99,20 +107,20 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc11_13.2: type) { -// 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: generic fn @F(@Class.%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: %Class.2](%n: %T) { +// CHECK:STDOUT: fn[%self.loc16: %Class.2](%n.loc16: %T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -123,16 +131,16 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@F.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class(@Class.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index bc69f82f9305..1e2b74f050d6 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -95,11 +95,11 @@ fn Run() { // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} -// CHECK:STDOUT: %Field.decl: type = class_decl @Field [template = constants.%Field] {} -// CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} -// CHECK:STDOUT: %ForwardDeclared.decl.loc13: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} {} +// CHECK:STDOUT: %Field.decl: type = class_decl @Field [template = constants.%Field] {} {} +// CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} {} +// CHECK:STDOUT: %ForwardDeclared.decl.loc13: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { @@ -123,16 +123,20 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] -// CHECK:STDOUT: %self.loc14_8.1: %ForwardDeclared = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_8.2: %ForwardDeclared = bind_name self, %self.loc14_8.1 +// CHECK:STDOUT: %self.patt: %ForwardDeclared = binding_pattern self +// 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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// 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.loc15_13.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc15_13.3: %.7 = bind_name self, %self.loc15_13.1 -// CHECK:STDOUT: %.loc15_8: %.7 = addr_pattern %self.loc15_13.3 +// 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: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -146,9 +150,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[@ForwardDeclared.%self.loc14_8.2: %ForwardDeclared](); +// CHECK:STDOUT: fn @F[%self: %ForwardDeclared](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr @ForwardDeclared.%self.loc15_13.3: %.7](); +// CHECK:STDOUT: fn @G[addr %self: %.7](); // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: @@ -185,7 +189,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+45, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+47, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -200,11 +204,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+32, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.10: %G.type = import_ref Main//a, inst+41, loaded [template = constants.%G] +// 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.11 = import_ref Main//a, inst+27, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+32, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//a, inst+41, 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -218,7 +222,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 77acab233f26..cb53498ee0fd 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -79,20 +79,24 @@ fn Run() { // CHECK:STDOUT: .Child = %Child.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Child.decl: type = class_decl @Child [template = constants.%Child] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %Child.decl: type = class_decl @Child [template = constants.%Child] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.loc5_8.1: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc5_8.2: %Base = bind_name self, %self.loc5_8.1 +// CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// 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: } // CHECK:STDOUT: %Unused.decl: %Unused.type = fn_decl @Unused [template = constants.%Unused] { -// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.loc6_13.1: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc6_13.2: %Base = bind_name self, %self.loc6_13.1 +// CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// 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: } // 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] @@ -123,9 +127,9 @@ fn Run() { // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[@Base.%self.loc5_8.2: %Base](); +// CHECK:STDOUT: fn @F[%self: %Base](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Unused[@Base.%self.loc6_13.2: %Base](); +// CHECK:STDOUT: fn @Unused[%self: %Base](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: @@ -158,7 +162,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+39, loaded [template = constants.%Child] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+41, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -170,12 +174,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+8, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Main//a, inst+27, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+33, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+40, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+44, 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -187,7 +191,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Child { diff --git a/toolchain/check/testdata/class/import_forward_decl.carbon b/toolchain/check/testdata/class/import_forward_decl.carbon index d6ba82284d1e..a504c375e1f1 100644 --- a/toolchain/check/testdata/class/import_forward_decl.carbon +++ b/toolchain/check/testdata/class/import_forward_decl.carbon @@ -46,7 +46,7 @@ class ForwardDecl { // CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} +// CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDecl; @@ -81,7 +81,7 @@ class ForwardDecl { // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} +// CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDecl { diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index c610ae1bec26..d6b82dadf8a7 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -127,7 +127,7 @@ var ptr: E* = &val; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index d714a010b2cb..16352e6a924f 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -55,7 +55,7 @@ fn Run() { // CHECK:STDOUT: .Cycle = %Cycle.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Cycle.decl: type = class_decl @Cycle [template = constants.%Cycle] {} +// CHECK:STDOUT: %Cycle.decl: type = class_decl @Cycle [template = constants.%Cycle] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { @@ -105,7 +105,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index faeebd04b325..15e50b42aa37 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -62,13 +62,13 @@ fn Run() { // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Cycle.decl.loc4: type = class_decl @Cycle [template = constants.%Cycle] {} +// CHECK:STDOUT: %Cycle.decl.loc4: type = class_decl @Cycle [template = constants.%Cycle] {} {} // CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, %Cycle.decl.loc4 [template = constants.%Cycle] // CHECK:STDOUT: %.loc6_18: type = ptr_type %Cycle [template = constants.%.1] // CHECK:STDOUT: %.loc6_19: type = struct_type {.b: %.1} [template = constants.%.2] // CHECK:STDOUT: %a.var: ref %.2 = var a // CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %Cycle.decl.loc8: type = class_decl @Cycle [template = constants.%Cycle] {} +// CHECK:STDOUT: %Cycle.decl.loc8: type = class_decl @Cycle [template = constants.%Cycle] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { @@ -124,7 +124,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 5128d28f459b..39fb3704ffe6 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -272,8 +272,8 @@ class B { // CHECK:STDOUT: .Circle = %Circle.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Shape.decl: type = class_decl @Shape [template = constants.%Shape] {} -// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} +// CHECK:STDOUT: %Shape.decl: type = class_decl @Shape [template = constants.%Shape] {} {} +// CHECK:STDOUT: %Circle.decl: type = class_decl @Circle [template = constants.%Circle] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { @@ -297,9 +297,11 @@ class B { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.loc12_18.1: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_18.2: %Circle = bind_name self, %self.loc12_18.1 +// 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) @@ -308,7 +310,7 @@ class B { // CHECK:STDOUT: %.loc12_44.4: type = value_of_initializer %int.make_type_32.loc12_41 [template = i32] // 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.var: ref %.8 = var +// CHECK:STDOUT: %return: ref %.8 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: @@ -321,28 +323,28 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[@Circle.%self.loc12_18.2: %Circle]() -> @Circle.%return.var: %.8 { +// CHECK:STDOUT: fn @GetPosition[%self: %Circle]() -> %return: %.8 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref.loc13_13: %Circle = name_ref self, @Circle.%self.loc12_18.2 +// 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] // CHECK:STDOUT: %.loc13_17.1: ref %Shape = class_element_access %self.ref.loc13_13, element0 // CHECK:STDOUT: %.loc13_17.2: ref %Shape = converted %self.ref.loc13_13, %.loc13_17.1 // CHECK:STDOUT: %.loc13_17.3: ref i32 = class_element_access %.loc13_17.2, element0 -// CHECK:STDOUT: %self.ref.loc13_21: %Circle = name_ref self, @Circle.%self.loc12_18.2 +// CHECK:STDOUT: %self.ref.loc13_21: %Circle = name_ref self, %self // CHECK:STDOUT: %y.ref: %.2 = name_ref y, @Shape.%.loc6_18 [template = @Shape.%.loc6_18] // CHECK:STDOUT: %.loc13_25.1: ref %Shape = class_element_access %self.ref.loc13_21, element0 // CHECK:STDOUT: %.loc13_25.2: ref %Shape = converted %self.ref.loc13_21, %.loc13_25.1 // CHECK:STDOUT: %.loc13_25.3: ref i32 = class_element_access %.loc13_25.2, element1 // CHECK:STDOUT: %.loc13_27.1: %.8 = tuple_literal (%.loc13_17.3, %.loc13_25.3) // CHECK:STDOUT: %.loc13_17.4: i32 = bind_value %.loc13_17.3 -// CHECK:STDOUT: %.loc13_27.2: ref i32 = tuple_access @Circle.%return.var, element0 +// CHECK:STDOUT: %.loc13_27.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc13_27.3: init i32 = initialize_from %.loc13_17.4 to %.loc13_27.2 // CHECK:STDOUT: %.loc13_25.4: i32 = bind_value %.loc13_25.3 -// CHECK:STDOUT: %.loc13_27.4: ref i32 = tuple_access @Circle.%return.var, element1 +// CHECK:STDOUT: %.loc13_27.4: ref i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc13_27.5: init i32 = initialize_from %.loc13_25.4 to %.loc13_27.4 -// CHECK:STDOUT: %.loc13_27.6: init %.8 = tuple_init (%.loc13_27.3, %.loc13_27.5) to @Circle.%return.var +// CHECK:STDOUT: %.loc13_27.6: init %.8 = tuple_init (%.loc13_27.3, %.loc13_27.5) to %return // CHECK:STDOUT: %.loc13_28: init %.8 = converted %.loc13_27.1, %.loc13_27.6 -// CHECK:STDOUT: return %.loc13_28 to @Circle.%return.var +// CHECK:STDOUT: return %.loc13_28 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- shadowing_access.carbon @@ -399,13 +401,13 @@ class B { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -416,11 +418,11 @@ class B { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_21.2: type = converted %int.make_type_32, %.loc10_21.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: @@ -435,12 +437,14 @@ class B { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.loc15_8.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc15_8.2: %C = bind_name self, %self.loc15_8.1 +// 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.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.11 [template = constants.%.12] // CHECK:STDOUT: @@ -457,9 +461,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[@C.%self.loc15_8.2: %C]() -> %.1 { +// CHECK:STDOUT: fn @G[%self: %C]() -> %.1 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %C = name_ref self, @C.%self.loc15_8.2 +// 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] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: %.loc15_43.1: ref %.1 = temporary_storage @@ -514,21 +518,21 @@ class B { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_32.loc5, %.loc5_32.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_32, %.loc5_32.1 [template = i32] // CHECK:STDOUT: %.loc5_38: i32 = int_literal 5 [template = constants.%.2] // CHECK:STDOUT: %SOME_CONSTANT: i32 = bind_name SOME_CONSTANT, %.loc5_38 -// CHECK:STDOUT: %SomeProtectedFunction.decl: %SomeProtectedFunction.type = fn_decl @SomeProtectedFunction [template = constants.%SomeProtectedFunction] { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32.loc6, %.loc6_43.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %SomeProtectedFunction.decl: %SomeProtectedFunction.type = fn_decl @SomeProtectedFunction [template = constants.%SomeProtectedFunction] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32, %.loc6_43.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -541,17 +545,17 @@ class B { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc12: %.6 = base_decl %A, element0 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc14: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc18: ref i32 = var +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32, %.loc18_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -631,8 +635,8 @@ class B { // CHECK:STDOUT: .Square = %Square.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Shape.decl: type = class_decl @Shape [template = constants.%Shape] {} -// CHECK:STDOUT: %Square.decl: type = class_decl @Square [template = constants.%Square] {} +// CHECK:STDOUT: %Shape.decl: type = class_decl @Shape [template = constants.%Shape] {} {} +// CHECK:STDOUT: %Square.decl: type = class_decl @Square [template = constants.%Square] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { @@ -651,13 +655,15 @@ class B { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] -// CHECK:STDOUT: %self.loc11_18.1: %Square = param self, runtime_param0 -// CHECK:STDOUT: %self.loc11_18.2: %Square = bind_name self, %self.loc11_18.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -670,9 +676,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[@Square.%self.loc11_18.2: %Square]() -> i32 { +// CHECK:STDOUT: fn @GetPosition[%self: %Square]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Square = name_ref self, @Square.%self.loc11_18.2 +// CHECK:STDOUT: %self.ref: %Square = name_ref self, %self // CHECK:STDOUT: %y.ref: = name_ref y, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -710,12 +716,12 @@ class B { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -770,12 +776,12 @@ class B { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -837,12 +843,12 @@ class B { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -853,7 +859,7 @@ class B { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc9: %.5 = base_decl %B, element0 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc18: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -915,12 +921,12 @@ class B { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -931,7 +937,7 @@ class B { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc9: %.5 = base_decl %B, element0 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -1001,9 +1007,9 @@ class B { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %Internal.decl: type = class_decl @Internal [template = constants.%Internal] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %Internal.decl: type = class_decl @Internal [template = constants.%Internal] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -1041,20 +1047,22 @@ class B { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %Internal.ref: type = name_ref Internal, file.%Internal.decl [template = constants.%Internal] // CHECK:STDOUT: %.loc14: %.6 = field_decl internal, element0 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc16: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %SomeFunc.decl: %SomeFunc.type = fn_decl @SomeFunc [template = constants.%SomeFunc] { +// CHECK:STDOUT: %self.patt: %B = binding_pattern self +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.loc36_15.1: %B = param self, runtime_param0 -// CHECK:STDOUT: %self.loc36_15.2: %B = bind_name self, %self.loc36_15.1 -// CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_32.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] -// CHECK:STDOUT: %.loc36_32.2: type = converted %int.make_type_32.loc36, %.loc36_32.1 [template = i32] -// CHECK:STDOUT: %return.var.loc36: ref i32 = var +// 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: } // CHECK:STDOUT: %.loc46: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1076,9 +1084,9 @@ class B { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeFunc[@B.%self.loc36_15.2: %B]() -> i32 { +// CHECK:STDOUT: fn @SomeFunc[%self: %B]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %B = name_ref self, @B.%self.loc36_15.2 +// CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %internal.ref: %.6 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] // CHECK:STDOUT: %.loc44_16.1: ref %Internal = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc44_16.2: %Internal = bind_value %.loc44_16.1 @@ -1129,8 +1137,8 @@ class B { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -1149,9 +1157,11 @@ class B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.loc10_8.1: %B = param self, runtime_param0 -// CHECK:STDOUT: %self.loc10_8.2: %B = bind_name self, %self.loc10_8.1 +// CHECK:STDOUT: %self.param: %B = param self, runtime_param0 +// CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1164,9 +1174,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[@B.%self.loc10_8.2: %B]() { +// CHECK:STDOUT: fn @F[%self: %B]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %B = name_ref self, @B.%self.loc10_8.2 +// CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: return @@ -1215,8 +1225,8 @@ class B { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%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: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -1235,9 +1245,11 @@ class B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.loc11_8.1: %B = param self, runtime_param0 -// CHECK:STDOUT: %self.loc11_8.2: %B = bind_name self, %self.loc11_8.1 +// CHECK:STDOUT: %self.param: %B = param self, runtime_param0 +// CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1250,9 +1262,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[@B.%self.loc11_8.2: %B]() { +// CHECK:STDOUT: fn @F[%self: %B]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %B = name_ref self, @B.%self.loc11_8.2 +// CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: %.2 = name_ref x, @A.%.loc5_18 [template = @A.%.loc5_18] // CHECK:STDOUT: %.loc12_9.1: ref %A = class_element_access %self.ref, element0 diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 72352c312a46..d7db88af15d2 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -64,32 +64,38 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: .MakeReorder = %MakeReorder.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%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: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_32.loc16, %.loc16_12.1 [template = i32] -// CHECK:STDOUT: %n.loc16_9.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Make.%n: i32 = bind_name n, %n.loc16_9.1 -// CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// 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.loc16_17.1: %.3 = param next, runtime_param1 -// CHECK:STDOUT: @Make.%next: %.3 = bind_name next, %next.loc16_17.1 -// CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @Make.%return: ref %Class = var +// 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: } // CHECK:STDOUT: %MakeReorder.decl: %MakeReorder.type = fn_decl @MakeReorder [template = constants.%MakeReorder] { -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_32.loc20, %.loc20_19.1 [template = i32] -// CHECK:STDOUT: %n.loc20_16.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @MakeReorder.%n: i32 = bind_name n, %n.loc20_16.1 -// CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// 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.loc20_24.1: %.3 = param next, runtime_param1 -// CHECK:STDOUT: @MakeReorder.%next: %.3 = bind_name next, %next.loc20_24.1 -// CHECK:STDOUT: %Class.ref.loc20_41: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @MakeReorder.%return: ref %Class = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index b85e3d5806d5..d714c32f24b5 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -142,18 +142,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %AdaptC.ref.loc15: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] { -// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @MakeC.%return: ref %C = var +// CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %MakeAdaptC.decl: %MakeAdaptC.type = fn_decl @MakeAdaptC [template = constants.%MakeAdaptC] { -// CHECK:STDOUT: %AdaptC.ref.loc21: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] -// CHECK:STDOUT: @MakeAdaptC.%return: ref %AdaptC = var +// CHECK:STDOUT: %MakeAdaptC.decl: %MakeAdaptC.type = fn_decl @MakeAdaptC [template = constants.%MakeAdaptC] {} { +// CHECK:STDOUT: %AdaptC.ref: type = name_ref AdaptC, file.%AdaptC.decl [template = constants.%AdaptC] +// CHECK:STDOUT: %return: ref %AdaptC = var // CHECK:STDOUT: } // CHECK:STDOUT: %AdaptC.ref.loc23: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %d.var: ref %AdaptC = var d @@ -294,12 +294,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -316,18 +316,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %AdaptC.ref.loc24: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %C.ref.loc33: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] { -// CHECK:STDOUT: %C.ref.loc35: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @MakeC.%return: ref %C = var +// CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %MakeAdaptC.decl: %MakeAdaptC.type = fn_decl @MakeAdaptC [template = constants.%MakeAdaptC] { -// CHECK:STDOUT: %AdaptC.ref.loc37: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] -// CHECK:STDOUT: @MakeAdaptC.%return: ref %AdaptC = var +// CHECK:STDOUT: %MakeAdaptC.decl: %MakeAdaptC.type = fn_decl @MakeAdaptC [template = constants.%MakeAdaptC] {} { +// CHECK:STDOUT: %AdaptC.ref: type = name_ref AdaptC, file.%AdaptC.decl [template = constants.%AdaptC] +// CHECK:STDOUT: %return: ref %AdaptC = var // CHECK:STDOUT: } // CHECK:STDOUT: %AdaptC.ref.loc46: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %d.var: ref %AdaptC = var d diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index bd8dad4c8c9b..3669e19e52ae 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -57,12 +57,12 @@ fn F() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 5ae8cf37f317..cdea11a65756 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -72,15 +72,15 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: .MakeOuter = %MakeOuter.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} -// CHECK:STDOUT: %MakeInner.decl: %MakeInner.type = fn_decl @MakeInner [template = constants.%MakeInner] { -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: @MakeInner.%return: ref %Inner = var +// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} +// CHECK:STDOUT: %MakeInner.decl: %MakeInner.type = fn_decl @MakeInner [template = constants.%MakeInner] {} { +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] +// CHECK:STDOUT: %return: ref %Inner = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} -// CHECK:STDOUT: %MakeOuter.decl: %MakeOuter.type = fn_decl @MakeOuter [template = constants.%MakeOuter] { -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, %Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: @MakeOuter.%return: ref %Outer = var +// CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} {} +// CHECK:STDOUT: %MakeOuter.decl: %MakeOuter.type = fn_decl @MakeOuter [template = constants.%MakeOuter] {} { +// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] +// CHECK:STDOUT: %return: ref %Outer = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 329936bfb253..fd08137a32f8 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -126,110 +126,124 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: .CallGOnInitializingExpr = %CallGOnInitializingExpr.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc20_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %Class = bind_name self, %self.loc20_12.1 +// CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { -// CHECK:STDOUT: %Class.ref.loc24: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc24_9.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @Call.%c: %Class = bind_name c, %c.loc24_9.1 -// CHECK:STDOUT: %int.make_type_32.loc24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_22.1: type = value_of_initializer %int.make_type_32.loc24 [template = i32] -// CHECK:STDOUT: %.loc24_22.2: type = converted %int.make_type_32.loc24, %.loc24_22.1 [template = i32] -// CHECK:STDOUT: @Call.%return: ref i32 = var +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// 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: } // CHECK:STDOUT: %CallAlias.decl: %CallAlias.type = fn_decl @CallAlias [template = constants.%CallAlias] { -// CHECK:STDOUT: %Class.ref.loc30: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.loc30_14.1: %Class = param c, runtime_param0 -// CHECK:STDOUT: @CallAlias.%c: %Class = bind_name c, %c.loc30_14.1 -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_27.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_27.2: type = converted %int.make_type_32.loc30, %.loc30_27.1 [template = i32] -// CHECK:STDOUT: @CallAlias.%return: ref i32 = var +// CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// 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: } -// CHECK:STDOUT: %CallOnConstBoundMethod.decl: %CallOnConstBoundMethod.type = fn_decl @CallOnConstBoundMethod [template = constants.%CallOnConstBoundMethod] { -// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_32.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] -// CHECK:STDOUT: %.loc34_32.2: type = converted %int.make_type_32.loc34, %.loc34_32.1 [template = i32] -// CHECK:STDOUT: @CallOnConstBoundMethod.%return: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc34_32.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc34_32.2: type = converted %int.make_type_32, %.loc34_32.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallWithAddr.decl: %CallWithAddr.type = fn_decl @CallWithAddr [template = constants.%CallWithAddr] { -// CHECK:STDOUT: %int.make_type_32.loc38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_22.1: type = value_of_initializer %int.make_type_32.loc38 [template = i32] -// CHECK:STDOUT: %.loc38_22.2: type = converted %int.make_type_32.loc38, %.loc38_22.1 [template = i32] -// CHECK:STDOUT: @CallWithAddr.%return: ref i32 = var +// CHECK:STDOUT: %CallWithAddr.decl: %CallWithAddr.type = fn_decl @CallWithAddr [template = constants.%CallWithAddr] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc38_22.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc38_22.2: type = converted %int.make_type_32, %.loc38_22.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallFThroughPointer.decl: %CallFThroughPointer.type = fn_decl @CallFThroughPointer [template = constants.%CallFThroughPointer] { -// CHECK:STDOUT: %Class.ref.loc43: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// 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.loc43_24.1: %.2 = param p, runtime_param0 -// CHECK:STDOUT: @CallFThroughPointer.%p: %.2 = bind_name p, %p.loc43_24.1 -// CHECK:STDOUT: %int.make_type_32.loc43: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc43_38.1: type = value_of_initializer %int.make_type_32.loc43 [template = i32] -// CHECK:STDOUT: %.loc43_38.2: type = converted %int.make_type_32.loc43, %.loc43_38.1 [template = i32] -// CHECK:STDOUT: @CallFThroughPointer.%return: ref i32 = var +// 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: } // CHECK:STDOUT: %CallGThroughPointer.decl: %CallGThroughPointer.type = fn_decl @CallGThroughPointer [template = constants.%CallGThroughPointer] { -// CHECK:STDOUT: %Class.ref.loc47: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// 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.loc47_24.1: %.2 = param p, runtime_param0 -// CHECK:STDOUT: @CallGThroughPointer.%p: %.2 = bind_name p, %p.loc47_24.1 -// CHECK:STDOUT: %int.make_type_32.loc47: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc47_38.1: type = value_of_initializer %int.make_type_32.loc47 [template = i32] -// CHECK:STDOUT: %.loc47_38.2: type = converted %int.make_type_32.loc47, %.loc47_38.1 [template = i32] -// CHECK:STDOUT: @CallGThroughPointer.%return: ref i32 = var +// 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: } -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %Class.ref.loc51: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: @Make.%return: ref %Class = var +// 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] +// CHECK:STDOUT: %return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallFOnInitializingExpr.decl: %CallFOnInitializingExpr.type = fn_decl @CallFOnInitializingExpr [template = constants.%CallFOnInitializingExpr] { -// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_33.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] -// CHECK:STDOUT: %.loc53_33.2: type = converted %int.make_type_32.loc53, %.loc53_33.1 [template = i32] -// CHECK:STDOUT: @CallFOnInitializingExpr.%return: ref i32 = var +// CHECK:STDOUT: %CallFOnInitializingExpr.decl: %CallFOnInitializingExpr.type = fn_decl @CallFOnInitializingExpr [template = constants.%CallFOnInitializingExpr] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc53_33.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc53_33.2: type = converted %int.make_type_32, %.loc53_33.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallGOnInitializingExpr.decl: %CallGOnInitializingExpr.type = fn_decl @CallGOnInitializingExpr [template = constants.%CallGOnInitializingExpr] { -// CHECK:STDOUT: %int.make_type_32.loc57: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_33.1: type = value_of_initializer %int.make_type_32.loc57 [template = i32] -// CHECK:STDOUT: %.loc57_33.2: type = converted %int.make_type_32.loc57, %.loc57_33.1 [template = i32] -// CHECK:STDOUT: @CallGOnInitializingExpr.%return: ref i32 = var +// CHECK:STDOUT: %CallGOnInitializingExpr.decl: %CallGOnInitializingExpr.type = fn_decl @CallGOnInitializingExpr [template = constants.%CallGOnInitializingExpr] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc57_33.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc57_33.2: type = converted %int.make_type_32, %.loc57_33.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // 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: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc12_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: %Class = bind_name self, %self.loc12_8.1 +// 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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// 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.loc13_13.1: %.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_13.3: %.2 = bind_name self, %self.loc13_13.1 -// CHECK:STDOUT: %.loc13_8: %.2 = addr_pattern %self.loc13_13.3 -// 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: %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: } // 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] -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32.loc17, %.loc17_10.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32, %.loc17_10.1 [template = i32] // CHECK:STDOUT: %.loc17_8: %.3 = field_decl k, element0 [template] // CHECK:STDOUT: %.loc18: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -243,16 +257,16 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.loc20: %Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Class = name_ref self, %self +// 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] // CHECK:STDOUT: %.loc21_14.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc21_14.2: i32 = bind_value %.loc21_14.1 // CHECK:STDOUT: return %.loc21_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr @Class.%self.loc13_13.3: %.2]() -> i32; +// CHECK:STDOUT: fn @G[addr %self: %.2]() -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Call(%c: %Class) -> i32 { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index aa8f11dbc990..d8ca7e96216a 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -97,19 +97,21 @@ fn F(a: Outer*) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%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: %Outer.ref: type = name_ref Outer, %Outer.decl [template = constants.%Outer] +// CHECK:STDOUT: %a.patt: %.4 = binding_pattern a +// 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.loc41_6.1: %.4 = param a, runtime_param0 -// CHECK:STDOUT: @F.2.%a: %.4 = bind_name a, %a.loc41_6.1 +// CHECK:STDOUT: %a.param: %.4 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.4 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} -// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} +// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [template = constants.%Outer] // CHECK:STDOUT: %.loc36_15: type = ptr_type %Outer [template = constants.%.4] // CHECK:STDOUT: %.loc36_9: %.8 = field_decl po, element0 [template] @@ -141,7 +143,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %.loc21_18: type = ptr_type %Inner [template = constants.%.2] // CHECK:STDOUT: %.loc21_11: %.3 = field_decl qi, element2 [template] -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %.loc28: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -187,7 +189,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%a: %.4) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] +// 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] // CHECK:STDOUT: %.loc42_21: type = ptr_type %Inner [template = constants.%.2] // CHECK:STDOUT: %a.ref.loc42: %.4 = name_ref a, %a diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 18f72393a520..5a66d49a0b0d 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -66,26 +66,30 @@ fn G(o: Outer) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%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: %Outer.ref.loc17: type = name_ref Outer, %Outer.decl [template = constants.%Outer] +// CHECK:STDOUT: %oi.patt: %Inner = binding_pattern oi +// 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.loc17_6.1: %Inner = param oi, runtime_param0 -// CHECK:STDOUT: @F.%oi: %Inner = bind_name oi, %oi.loc17_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Outer.ref.loc21: type = name_ref Outer, %Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %o.loc21_6.1: %Outer = param o, runtime_param0 -// CHECK:STDOUT: @G.%o: %Outer = bind_name o, %o.loc21_6.1 +// CHECK:STDOUT: %o.patt: %Outer = binding_pattern o +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} +// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} // CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index d1ba2d413542..6c71eefa9b15 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -50,7 +50,7 @@ var c: C = {}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 4910092d8b1d..3d7a564d8abe 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -291,7 +291,7 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -306,7 +306,7 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -321,7 +321,7 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -338,7 +338,7 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -361,8 +361,8 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -381,7 +381,7 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -401,8 +401,8 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -417,8 +417,8 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl.loc12 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -436,11 +436,11 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %.loc10: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -462,8 +462,8 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl.loc12 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -483,8 +483,8 @@ extern class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -575,7 +575,7 @@ extern class C; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -595,7 +595,7 @@ extern class C; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -618,7 +618,7 @@ extern class C; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -644,7 +644,7 @@ extern class C; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/class/no_prelude/extern_library.carbon b/toolchain/check/testdata/class/no_prelude/extern_library.carbon index b949d5a895f1..6c2b06e7fc11 100644 --- a/toolchain/check/testdata/class/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern_library.carbon @@ -25,7 +25,7 @@ extern library "foo" class C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; 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 f156e2ce5fde..5c9d466e052c 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -103,17 +103,21 @@ fn F(T:! type) { // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// 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: %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.loc6_24.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_24.2: type = bind_symbolic_name T 0, %T.loc6_24.1 [symbolic = @GenericAndParams.1.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.loc8_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T 0, %T.loc8_9.1 [symbolic = @C.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, %NotGenericNoParams.decl [template = constants.%NotGenericNoParams] // CHECK:STDOUT: %a.var: ref %NotGenericNoParams = var a // CHECK:STDOUT: %a: ref %NotGenericNoParams = bind_name a, %a.var @@ -157,8 +161,8 @@ fn F(T:! type) { // CHECK:STDOUT: .Self = constants.%NotGenericButParams.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @GenericAndParams.1(file.%T.loc6_24.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @GenericAndParams.1(%T.loc6: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -170,18 +174,20 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%T.loc8_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C(%T.loc8: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %GenericAndParams.type: type = generic_class_type @GenericAndParams.2, @C(%T) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] +// CHECK:STDOUT: %GenericAndParams.type: type = generic_class_type @GenericAndParams.2, @C(%T.1) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] // CHECK:STDOUT: %GenericAndParams: @C.%GenericAndParams.type (%GenericAndParams.type.2) = struct_value () [symbolic = %GenericAndParams (constants.%GenericAndParams.3)] // CHECK:STDOUT: // 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 = %GenericAndParams (constants.%GenericAndParams.3)] { -// CHECK:STDOUT: %U.loc10_26.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc10_26.2: type = bind_symbolic_name U 1, %U.loc10_26.1 [symbolic = @GenericAndParams.2.%U (constants.%U)] +// 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: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc10: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -192,7 +198,7 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @GenericNoParams(file.%T.loc8_9.2: type) { +// CHECK:STDOUT: generic class @GenericNoParams(@C.%T.loc8: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -203,8 +209,8 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @GenericAndParams.2(file.%T.loc8_9.2: type, @C.%U.loc10_26.2: type) { -// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic class @GenericAndParams.2(@C.%T.loc8: type, %U.loc10: type) { +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -249,31 +255,31 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => 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 => constants.%U +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@C.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @C(@C.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { -// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %T.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { -// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %T.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.3 @@ -281,7 +287,7 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%X, constants.%X) { -// CHECK:STDOUT: %U => constants.%X +// CHECK:STDOUT: %U.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -302,8 +308,10 @@ fn F(T:! type) { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { -// CHECK:STDOUT: %T.loc8_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.2: type = bind_name T, %T.loc8_9.1 +// CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %T.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -334,12 +342,16 @@ fn F(T:! type) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { -// CHECK:STDOUT: %T.loc7_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_9.2: type = bind_name T, %T.loc7_9.1 +// CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %T.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.loc10_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc10: type = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 1220949b2b78..f22faffbd142 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -90,7 +90,7 @@ class B {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -113,7 +113,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -135,7 +135,7 @@ class B {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -164,7 +164,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -184,7 +184,7 @@ class B {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -214,7 +214,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -240,7 +240,7 @@ class B {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %B: type = bind_alias B, %C.decl [template = constants.%C] // CHECK:STDOUT: } @@ -268,7 +268,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 9ceca505a5a8..4d8eabdddae6 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -147,7 +147,7 @@ private class Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Def [private] = %Def.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Def.decl: type = class_decl @Def [template = constants.%Def] {} +// CHECK:STDOUT: %Def.decl: type = class_decl @Def [template = constants.%Def] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Def { @@ -169,8 +169,8 @@ private class Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = class_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} -// CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = class_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = class_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = class_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardWithDef { @@ -190,7 +190,7 @@ private class Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Forward [private] = %Forward.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} +// CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Forward; @@ -411,12 +411,14 @@ private class Redecl {} // CHECK:STDOUT: %Test.import = import Test // 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: } { // 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.loc4_6.1: %.1 = param c, runtime_param0 -// CHECK:STDOUT: @F.%c: %.1 = bind_name c, %c.loc4_6.1 +// CHECK:STDOUT: %c.param: %.1 = param c, runtime_param0 +// CHECK:STDOUT: %c: %.1 = bind_name c, %c.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} +// CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Forward { @@ -445,10 +447,12 @@ private class Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc10: type = ptr_type [template = ] -// CHECK:STDOUT: %c.loc10_6.1: = param c, runtime_param0 -// CHECK:STDOUT: @F.%c: = bind_name c, %c.loc10_6.1 +// CHECK:STDOUT: %c.param: = param c, runtime_param0 +// CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -478,11 +482,13 @@ private class Redecl {} // CHECK:STDOUT: } // 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: } { // 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.loc9_6.1: = param c, runtime_param0 -// CHECK:STDOUT: @F.%c: = bind_name c, %c.loc9_6.1 +// CHECK:STDOUT: %c.param: = param c, runtime_param0 +// CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -503,8 +509,8 @@ private class Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %Redecl.decl.loc4: type = class_decl @Redecl [template = constants.%Redecl] {} -// CHECK:STDOUT: %Redecl.decl.loc6: type = class_decl @Redecl [template = constants.%Redecl] {} +// CHECK:STDOUT: %Redecl.decl.loc4: type = class_decl @Redecl [template = constants.%Redecl] {} {} +// CHECK:STDOUT: %Redecl.decl.loc6: type = class_decl @Redecl [template = constants.%Redecl] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Redecl { diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index c4d9c9ba1828..5ccfdb35a5b1 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -115,11 +115,11 @@ var x: () = D.C.F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -207,7 +207,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 55152a900e7e..12630a9ea8aa 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -81,7 +81,7 @@ class D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A; @@ -104,8 +104,8 @@ class D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc6: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %A.decl.loc6: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -145,7 +145,7 @@ class D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B; @@ -174,7 +174,7 @@ class D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -195,7 +195,7 @@ class D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -218,7 +218,7 @@ class D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D; diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 3cef5e9f9b1d..0e07e8126c36 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -202,28 +202,36 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Foo = %Foo.decl.loc7 // CHECK:STDOUT: .Bar = %Bar.decl.loc10 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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 = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc8_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_11.2: %C = bind_symbolic_name a 0, %a.loc8_11.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc10_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc10_11.2: %C = bind_symbolic_name a 0, %a.loc10_11.1 [symbolic = @Bar.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc10 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc11_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc11_11.2: %C = bind_symbolic_name a 0, %a.loc11_11.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -234,8 +242,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc7_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -247,8 +255,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Bar(file.%a.loc10_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Bar(%a.loc10: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -261,11 +269,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- spacing.carbon @@ -286,16 +294,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_17.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_17.2: %C = bind_symbolic_name a 0, %a.loc6_17.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc6 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_13.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_13.2: %C = bind_symbolic_name a 0, %a.loc7_13.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -306,8 +318,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_17.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -320,7 +332,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_parens.carbon @@ -344,16 +356,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc14_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc14_11.2: %C = bind_symbolic_name a 0, %a.loc14_11.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -364,14 +380,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%a.loc14_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @.1(%a.loc14: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -384,11 +400,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon @@ -409,16 +425,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc6 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,8 +449,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -443,7 +463,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.carbon @@ -469,18 +489,22 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc8_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_11.2: %C = bind_symbolic_name a 0, %a.loc8_11.1 [symbolic = @Bar.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -491,24 +515,24 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc7_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Bar(file.%a.loc8_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Bar(%a.loc8: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.impl.carbon @@ -530,8 +554,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+12, loaded [template = constants.%Foo.1] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+21, loaded [template = constants.%Bar.1] +// 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.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -545,14 +569,18 @@ 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: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.loc4_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc4_11.2: %C = bind_symbolic_name a 0, %a.loc4_11.1 [symbolic = constants.%a] +// 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: } // 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: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.loc5_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc5_11.2: %C = bind_symbolic_name a 0, %a.loc5_11.1 [symbolic = constants.%a] +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -562,7 +590,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -575,7 +603,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Bar(constants.%a: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -588,11 +616,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_name_mismatch.carbon @@ -618,18 +646,22 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %b.loc15_11.1: %C = param b, runtime_param -// CHECK:STDOUT: %b.loc15_11.2: %C = bind_symbolic_name b 0, %b.loc15_11.1 [symbolic = @.1.%b (constants.%b)] +// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b 0 +// 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: %C = bind_symbolic_name b 0, %b.param [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -640,14 +672,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc7_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%b.loc15_11.2: %C) { -// CHECK:STDOUT: %b: %C = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] +// CHECK:STDOUT: generic class @.1(%b.loc15: %C) { +// CHECK:STDOUT: %b.1: %C = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -660,11 +692,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias.carbon @@ -689,18 +721,22 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a 0, %a.loc15_11.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -711,14 +747,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc7_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%a.loc15_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @.1(%a.loc15: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -731,11 +767,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduced_alias.carbon @@ -760,18 +796,22 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a 0, %a.loc15_11.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -782,14 +822,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc7_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%a.loc15_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @.1(%a.loc15: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -802,11 +842,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- alias_two_file.carbon @@ -827,11 +867,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -842,14 +884,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_alias_two_file.impl.carbon @@ -867,7 +909,7 @@ fn Base.F[addr self: Base*]() { // 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.1] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+11, loaded [template = constants.%Foo.1] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -882,9 +924,11 @@ 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: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc6_11.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -894,7 +938,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -907,7 +951,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_repeat_const.carbon @@ -932,19 +976,23 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a 0 +// 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.loc6_11.1: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %.3 = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc6: %.3 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a 0 +// 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.loc18_11.1: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc18_11.2: %.3 = bind_symbolic_name a 0, %a.loc18_11.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc18: %.3 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -955,19 +1003,19 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %.3) { -// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(%a.loc6: %.3) { +// CHECK:STDOUT: %a.1: %.3 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%a.loc18_11.2: %.3) { -// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @.1(%a.loc18: %.3) { +// CHECK:STDOUT: %a.1: %.3 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc18: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_33: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.6 @@ -975,11 +1023,11 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_self_type.carbon @@ -1003,13 +1051,15 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.6] { -// CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] +// CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// 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.loc16_16.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: @.1.%self: %.3 = bind_name self, %self.loc16_16.1 -// CHECK:STDOUT: @.1.%.loc16: %.3 = addr_pattern @.1.%self +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1018,11 +1068,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // 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: } { // 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.loc7_13.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_13.3: %.3 = bind_name self, %self.loc7_13.1 -// CHECK:STDOUT: %.loc7_8: %.3 = addr_pattern %self.loc7_13.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: } // CHECK:STDOUT: %.loc8: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -1032,7 +1084,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr @Base.%self.loc7_13.3: %.3](); +// CHECK:STDOUT: fn @F[addr %self: %.3](); // CHECK:STDOUT: // CHECK:STDOUT: fn @.1[addr %self: %.3]() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index c56f663577cc..4a7ae2faf65a 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -64,28 +64,34 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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.patt.loc17_30: i32 = binding_pattern r#self +// 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.loc17_17.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: @F.%self.loc17_17: %.1 = bind_name self, %self.loc17_17.1 -// CHECK:STDOUT: @F.%.loc17: %.1 = addr_pattern @F.%self.loc17_17 +// 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.loc17_30.1: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: @F.%self.loc17_30: i32 = bind_name r#self, %self.loc17_30.1 +// 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: } // 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.patt.loc21_24: i32 = binding_pattern r#self +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc21_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @G.%self.loc21_12: %Class = bind_name self, %self.loc21_12.1 +// 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.loc21_24.1: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: @G.%self.loc21_24: i32 = bind_name r#self, %self.loc21_24.1 +// 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) @@ -94,32 +100,38 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc21_49.4: type = value_of_initializer %int.make_type_32.loc21_46 [template = 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: @G.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // 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.patt.loc17_30: i32 = binding_pattern r#self +// 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.loc12_13.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 +// 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.loc12_26.1: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc12_26.2: i32 = bind_name r#self, %self.loc12_26.1 +// 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: } // 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.patt.loc21_24: i32 = binding_pattern r#self +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc13_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8.2: %Class = bind_name self, %self.loc13_8.1 +// 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.loc13_20.1: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc13_20.2: i32 = bind_name r#self, %self.loc13_20.1 +// 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) @@ -128,11 +140,11 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc13_45.4: type = value_of_initializer %int.make_type_32.loc13_42 [template = 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: ref %.4 = var +// CHECK:STDOUT: %return.var.loc13: ref %.4 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.5 = field_decl n, element0 [template] // CHECK:STDOUT: %.loc15: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index 3c4026560bcb..4157c460211e 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -60,20 +60,23 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: .MemberNamedSelf = %MemberNamedSelf.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %MemberNamedSelf.decl: type = class_decl @MemberNamedSelf [template = constants.%MemberNamedSelf] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// 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: %y.patt: %Self = binding_pattern y +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc24_25: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %x.loc24_22.1: %MemberNamedSelf = param x, runtime_param0 -// CHECK:STDOUT: @F.2.%x: %MemberNamedSelf = bind_name x, %x.loc24_22.1 +// 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.loc24_31.1: %Self = param y, runtime_param1 -// CHECK:STDOUT: @F.2.%y: %Self = bind_name y, %y.loc24_31.1 +// CHECK:STDOUT: %y.param.loc24: %Self = param y, runtime_param1 +// CHECK:STDOUT: %y.loc24: %Self = bind_name y, %y.param.loc24 // 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -82,14 +85,17 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @MemberNamedSelf { -// CHECK:STDOUT: %Self.decl: type = class_decl @Self [template = constants.%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: %y.patt: %Self = binding_pattern y +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21_11: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %x.loc21_8.1: %MemberNamedSelf = param x, runtime_param0 -// CHECK:STDOUT: %x.loc21_8.2: %MemberNamedSelf = bind_name x, %x.loc21_8.1 -// CHECK:STDOUT: %Self.ref.loc21_20: type = name_ref r#Self, %Self.decl [template = constants.%Self] -// CHECK:STDOUT: %y.loc21_17.1: %Self = param y, runtime_param1 -// CHECK:STDOUT: %y.loc21_17.2: %Self = bind_name y, %y.loc21_17.1 +// 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: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -122,7 +128,7 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%x: %MemberNamedSelf, %y: %Self) { +// CHECK:STDOUT: fn @F.2(%x.loc24: %MemberNamedSelf, %y.loc24: %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 842826f1f56a..bdd5a0ab6cf4 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -51,30 +51,36 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: .Class = %Class.decl.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl.loc11: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %Class.decl.loc13: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl.loc11: type = class_decl @Class [template = constants.%Class] {} {} +// 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.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc17_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %Class = bind_name self, %self.loc17_12.1 -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_27.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc17_27.2: type = converted %bool.make_type, %.loc17_27.1 [template = bool] -// CHECK:STDOUT: %b.loc17_24.1: bool = param b, runtime_param1 -// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc17_24.1 +// CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc14_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_8.2: %Class = bind_name self, %self.loc14_8.1 -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc14_23.2: type = converted %bool.make_type, %.loc14_23.1 [template = bool] -// CHECK:STDOUT: %b.loc14_20.1: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc14_20.2: bool = bind_name b, %b.loc14_20.1 +// CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -85,7 +91,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: %Class](%b: bool) { +// CHECK:STDOUT: fn @F[%self.loc17: %Class](%b.loc17: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/redeclaration_introducer.carbon b/toolchain/check/testdata/class/redeclaration_introducer.carbon index d28b33987eda..1ec4364bc483 100644 --- a/toolchain/check/testdata/class/redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/redeclaration_introducer.carbon @@ -47,12 +47,12 @@ abstract class C {} // CHECK:STDOUT: .C = %C.decl.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl.loc11: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl.loc13: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %A.decl.loc15: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %B.decl.loc16: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %A.decl.loc11: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl.loc13: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %A.decl.loc15: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl.loc16: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index db0159d3863b..7ff6eb0b9b28 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -55,27 +55,27 @@ fn Class.F() -> i32 { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_17.2: type = converted %int.make_type_32, %.loc16_17.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// 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: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc16_17.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] +// CHECK:STDOUT: %.loc16_17.2: type = converted %int.make_type_32.loc16, %.loc16_17.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] // CHECK:STDOUT: %return.var.loc12: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc13: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index c897c9a6d636..2e7ade15d0df 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -56,21 +56,21 @@ class Class { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc12: ref i32 = var +// 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] +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc16: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 049df4cd7607..a914a3b7e239 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -113,13 +113,13 @@ class A { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %AF.decl: %AF.type = fn_decl @AF [template = constants.%AF] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %AF.decl: %AF.type = fn_decl @AF [template = constants.%AF] {} {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc46_10.2: type = converted %int.make_type_32, %.loc46_10.1 [template = i32] @@ -134,8 +134,8 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %BF.decl: %BF.type = fn_decl @BF [template = constants.%BF] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %BF.decl: %BF.type = fn_decl @BF [template = constants.%BF] {} {} // 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] @@ -150,9 +150,9 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} -// CHECK:STDOUT: %CF.decl: %CF.type = fn_decl @CF [template = constants.%CF] {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} +// CHECK:STDOUT: %CF.decl: %CF.type = fn_decl @CF [template = constants.%CF] {} {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc42_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc42_12.2: type = converted %int.make_type_32, %.loc42_12.1 [template = i32] @@ -167,8 +167,8 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_14.2: type = converted %int.make_type_32, %.loc24_14.1 [template = i32] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 598a142389fc..ec89f1ff4048 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -72,28 +72,28 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %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: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: @F.2.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // 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: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc12: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} { +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.var.loc16: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 889eedafac60..70fd4874630a 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -62,53 +62,61 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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: } { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc18_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %Class = bind_name self, %self.loc18_12.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// 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.loc22_17.1: %.2 = param self, runtime_param0 -// CHECK:STDOUT: @G.%self: %.2 = bind_name self, %self.loc22_17.1 -// CHECK:STDOUT: @G.%.loc22: %.2 = addr_pattern @G.%self +// 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: @G.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc12_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: %Class = bind_name self, %self.loc12_8.1 +// 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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// 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.loc13_13.1: %.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_13.3: %.2 = bind_name self, %self.loc13_13.1 -// CHECK:STDOUT: %.loc13_8: %.2 = addr_pattern %self.loc13_13.3 +// 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: } -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32.loc15, %.loc15_10.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32, %.loc15_10.1 [template = i32] // CHECK:STDOUT: %.loc15_8: %.3 = field_decl n, element0 [template] // CHECK:STDOUT: %.loc16: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -121,18 +129,18 @@ 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: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.loc18: %Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Class = name_ref self, %self +// 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] // CHECK:STDOUT: %.loc19_14.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc19_14.2: i32 = bind_value %.loc19_14.1 // CHECK:STDOUT: return %.loc19_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %.2]() -> i32 { +// CHECK:STDOUT: fn @G[addr %self.loc22: %.2]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.2 = name_ref self, %self +// CHECK:STDOUT: %self.ref: %.2 = name_ref self, %self.loc22 // CHECK:STDOUT: %.loc23_11: ref %Class = deref %self.ref // CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc15_8 [template = @Class.%.loc15_8] // CHECK:STDOUT: %.loc23_17.1: ref i32 = class_element_access %.loc23_11, element0 diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index d49727e7360d..6872434edba7 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -83,33 +83,39 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: .Call = %Call.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// 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: %Base.ref.loc22: type = name_ref Base, %Base.decl [template = constants.%Base] -// CHECK:STDOUT: %self.loc22_21.1: %Base = param self, runtime_param0 -// CHECK:STDOUT: @SelfBase.%self: %Base = bind_name self, %self.loc22_21.1 +// CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// 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: @SelfBase.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { -// CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, %Base.decl [template = constants.%Base] +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// 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.loc26_30.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: @AddrSelfBase.%self: %.7 = bind_name self, %self.loc26_30.1 -// CHECK:STDOUT: @AddrSelfBase.%.loc26: %.7 = addr_pattern @AddrSelfBase.%self +// 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: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// 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.loc30_9.1: %.11 = param p, runtime_param0 -// CHECK:STDOUT: @Call.%p: %.11 = bind_name p, %p.loc30_9.1 -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_32.loc30, %.loc30_25.1 [template = i32] -// CHECK:STDOUT: @Call.%return: ref i32 = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -126,23 +132,27 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { -// CHECK:STDOUT: %Base.ref.loc16: type = name_ref Base, file.%Base.decl [template = constants.%Base] +// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // 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: } { // CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %self.loc18_15.1: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_15.2: %Base = bind_name self, %self.loc18_15.1 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_32.2: type = converted %int.make_type_32, %.loc18_32.1 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// 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: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// 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.loc19_24.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_24.3: %.7 = bind_name self, %self.loc19_24.1 -// CHECK:STDOUT: %.loc19_19: %.7 = addr_pattern %self.loc19_24.3 +// 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: } // CHECK:STDOUT: %.loc20: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: @@ -156,18 +166,18 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfBase[%self: %Base]() -> i32 { +// CHECK:STDOUT: fn @SelfBase[%self.loc22: %Base]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Base = name_ref self, %self +// 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] // CHECK:STDOUT: %.loc23_14.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc23_14.2: i32 = bind_value %.loc23_14.1 // CHECK:STDOUT: return %.loc23_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrSelfBase[addr %self: %.7]() { +// CHECK:STDOUT: fn @AddrSelfBase[addr %self.loc26: %.7]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.7 = name_ref self, %self +// CHECK:STDOUT: %self.ref: %.7 = name_ref self, %self.loc26 // CHECK:STDOUT: %.loc27_4: ref %Base = deref %self.ref // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // CHECK:STDOUT: %.loc27_10: ref i32 = class_element_access %.loc27_4, element0 diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index a6f2f8319fd9..7dfb5c44ab46 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -61,33 +61,37 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// 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.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc21_12.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %Class = bind_name self, %self.loc21_12.1 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_29.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_29.2: type = converted %int.make_type_32, %.loc21_29.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// 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: } // 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: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.loc12_8.1: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: %Class = bind_name self, %self.loc12_8.1 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32, %.loc12_25.1 [template = i32] +// 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: } -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// 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] -// CHECK:STDOUT: %return.var.loc13: ref %Class = var +// CHECK:STDOUT: %return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc18_14: type = ptr_type %Class [template = constants.%.2] // CHECK:STDOUT: %.loc18_8: %.3 = field_decl p, element0 [template] // CHECK:STDOUT: %.loc19: = complete_type_witness %.4 [template = constants.%.5] @@ -101,9 +105,9 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.loc21: %Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Class = name_ref self, %self +// 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] // CHECK:STDOUT: %.loc22_16.1: ref %.2 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc22_16.2: %.2 = bind_value %.loc22_16.1 @@ -117,10 +121,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: return %.loc22_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make() -> @Class.%return.var.loc13: %Class { +// CHECK:STDOUT: fn @Make() -> %return: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %s: ref %Class = bind_name s, @Class.%return.var.loc13 +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %s: ref %Class = bind_name s, %return // CHECK:STDOUT: %s.ref.loc15_5: ref %Class = name_ref s, %s // CHECK:STDOUT: %s.ref.loc15_16: ref %Class = name_ref s, %s // CHECK:STDOUT: %.loc15_15: %.2 = addr_of %s.ref.loc15_16 @@ -130,6 +134,6 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %.loc15_17.4: init %Class = class_init (%.loc15_17.3), %s.ref.loc15_5 // CHECK:STDOUT: %.loc15_7: init %Class = converted %.loc15_17.1, %.loc15_17.4 // CHECK:STDOUT: assign %s.ref.loc15_5, %.loc15_7 -// CHECK:STDOUT: return %s to @Class.%return.var.loc13 +// CHECK:STDOUT: return %s to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index a38da15d2373..e4a82cc41d1f 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -55,21 +55,21 @@ fn Run() -> i32 { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// 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] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: @Run.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // 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: %return.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index a55ce33fb613..ad3b3bdb909b 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -71,48 +71,54 @@ 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: } { // 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.loc2_9.1: i32 = param a, runtime_param -// CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a 0, %a.loc2_9.1 [symbolic = @C.%a (constants.%a)] +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param +// CHECK:STDOUT: %a.loc2: i32 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc3: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, %C.decl [template = constants.%C.1] +// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b 0 +// 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.loc3_9.1: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b 0, %b.loc3_9.1 [symbolic = @D.%b (constants.%b)] +// CHECK:STDOUT: %b.param.loc3: %C.3 = param b, runtime_param +// CHECK:STDOUT: %b.loc3: %C.3 = bind_symbolic_name b 0, %b.param.loc3 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc4: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %C.ref.loc4: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc4: i32 = int_literal 1000 [template = constants.%.4] +// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b 0 +// 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.loc4_9.1: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc4_9.2: %C.3 = bind_symbolic_name b 0, %b.loc4_9.1 [symbolic = constants.%b] +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%a.loc2_9.2: i32) { -// CHECK:STDOUT: %a: i32 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @C(%a.loc2: i32) { +// CHECK:STDOUT: %a.1: i32 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc2: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D(file.%b.loc3_9.2: %C.3) { -// CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] +// CHECK:STDOUT: generic class @D(%b.loc3: %C.3) { +// CHECK:STDOUT: %b.1: %C.3 = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D.2 @@ -122,15 +128,15 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.4) { -// CHECK:STDOUT: %a => constants.%.4 +// CHECK:STDOUT: %a.1 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_int_mismatch.carbon @@ -179,54 +185,60 @@ 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: } { // 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.loc2_9.1: i32 = param a, runtime_param -// CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a 0, %a.loc2_9.1 [symbolic = @C.%a (constants.%a)] +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param +// CHECK:STDOUT: %a.loc2: i32 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, %C.decl [template = constants.%C.1] +// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b 0 +// 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.loc3: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.loc3_9.1: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b 0, %b.loc3_9.1 [symbolic = @D.%b (constants.%b)] +// 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: %C.3 = bind_symbolic_name b 0, %b.param [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc10: i32 = int_literal 1000 [template = constants.%.4] -// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.loc10_9.1: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc10_9.2: %C.3 = bind_symbolic_name b 0, %b.loc10_9.1 [symbolic = @.1.%b (constants.%b)] +// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b 0 +// 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: %C.3 = bind_symbolic_name b 0, %b.param [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%a.loc2_9.2: i32) { -// CHECK:STDOUT: %a: i32 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @C(%a.loc2: i32) { +// CHECK:STDOUT: %a.1: i32 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc2: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D(file.%b.loc3_9.2: %C.3) { -// CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] +// CHECK:STDOUT: generic class @D(%b.loc3: %C.3) { +// CHECK:STDOUT: %b.1: %C.3 = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%b.loc10_9.2: %C.3) { -// CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] +// CHECK:STDOUT: generic class @.1(%b.loc10: %C.3) { +// CHECK:STDOUT: %b.1: %C.3 = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc10: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.6 @@ -236,18 +248,18 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.4) { -// CHECK:STDOUT: %a => constants.%.4 +// CHECK:STDOUT: %a.1 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/todo_access_modifiers.carbon b/toolchain/check/testdata/class/todo_access_modifiers.carbon index d09cf7de23ab..e89826662f12 100644 --- a/toolchain/check/testdata/class/todo_access_modifiers.carbon +++ b/toolchain/check/testdata/class/todo_access_modifiers.carbon @@ -56,12 +56,12 @@ class Access { // CHECK:STDOUT: .Access = %Access.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Access.decl: type = class_decl @Access [template = constants.%Access] {} +// CHECK:STDOUT: %Access.decl: type = class_decl @Access [template = constants.%Access] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Access { -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_32.loc17, %.loc17_18.1 [template = i32] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 02774942abe2..200e93dc412a 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -63,13 +63,13 @@ abstract class Abstract { // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} +// CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} +// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} -// CHECK:STDOUT: %I.decl: %I.type = fn_decl @I [template = constants.%I] {} +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} +// CHECK:STDOUT: %I.decl: %I.type = fn_decl @I [template = constants.%I] {} {} // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -79,9 +79,9 @@ abstract class Abstract { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Abstract { -// CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] {} -// CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] {} -// CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} +// CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] {} {} +// CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] {} {} +// CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} {} // CHECK:STDOUT: %.loc24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index 396fc8f054ba..f197b7ec4649 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -56,36 +56,40 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: } // 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: } { // 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] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_15, %.loc11_9.1 [template = 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.loc11_6.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @A.%p: %.4 = bind_name p, %p.loc11_6.1 +// 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] // CHECK:STDOUT: %.loc11_25.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: %.loc11_34: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc11_35: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: @A.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { +// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// 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.loc15_6.1: %.6 = param p, runtime_param0 -// CHECK:STDOUT: @B.%p: %.6 = bind_name p, %p.loc15_6.1 +// 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: @B.%return: ref %.6 = var +// CHECK:STDOUT: %return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 739a936786c8..88619f0dd78d 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -51,14 +51,16 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: } // 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: } { // 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] // CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15_15, %.loc15_9.1 [template = 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.loc15_6.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @F.%p: %.4 = bind_name p, %p.loc15_6.1 +// 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] @@ -66,7 +68,7 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %.loc15_25: type = const_type %.2 [template = constants.%.2] // CHECK:STDOUT: %.loc15_42: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc15_43: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: @F.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index cfc02de0c6f2..8f37c5394f31 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -67,12 +67,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -82,6 +82,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: } // 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: } { // 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] @@ -89,14 +91,14 @@ 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.loc15_6.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @G.%p: %.4 = bind_name p, %p.loc15_6.1 +// 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: @G.%return: ref %.6 = var +// CHECK:STDOUT: %return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 4b515d5dea22..868df6893ac0 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -61,12 +61,12 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: .a_ptr_ref = %a_ptr_ref // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// 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: %.loc4_11.3: type = const_type i32 [template = constants.%.2] -// CHECK:STDOUT: @F.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 3da1e252ac4c..532cdd25f9b8 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -49,11 +49,13 @@ 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: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %N.loc12_6.1: i32 = param N, runtime_param -// CHECK:STDOUT: @G.%N.loc12: i32 = bind_symbolic_name N 0, %N.loc12_6.1 [symbolic = @G.%N.1 (constants.%N)] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N 0 +// 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: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -66,10 +68,10 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.loc12: i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc12 [symbolic = %N.1 (constants.%N)] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32, %.loc16_11.1 [template = i32] +// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] +// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32.loc16, %.loc16_11.1 [template = i32] // CHECK:STDOUT: %.loc16_17: type = array_type %N.ref, i32 [template = ] // CHECK:STDOUT: %k.var: ref = var k // CHECK:STDOUT: %k: ref = bind_name k, %k.var diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 5a2a2f2d356d..373d09a66615 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -54,8 +54,10 @@ 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.loc12_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc12: type = bind_symbolic_name T 0, %T.loc12_6.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index b3f94eb3b795..8a265e50b312 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -61,7 +61,7 @@ fn H() -> i32 { // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_20.1: %.2 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17) @@ -70,9 +70,9 @@ fn H() -> i32 { // CHECK:STDOUT: %.loc11_20.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] // CHECK:STDOUT: %.loc11_20.5: type = converted %int.make_type_32.loc11_17, %.loc11_20.4 [template = i32] // CHECK:STDOUT: %.loc11_20.6: type = converted %.loc11_20.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc13_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_20.1: %.2 = tuple_literal (%int.make_type_32.loc13_12, %int.make_type_32.loc13_17) @@ -81,13 +81,13 @@ fn H() -> i32 { // CHECK:STDOUT: %.loc13_20.4: type = value_of_initializer %int.make_type_32.loc13_17 [template = i32] // CHECK:STDOUT: %.loc13_20.5: type = converted %int.make_type_32.loc13_17, %.loc13_20.4 [template = i32] // CHECK:STDOUT: %.loc13_20.6: type = converted %.loc13_20.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @G.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32.loc19, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: @H.%return: ref i32 = var +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -117,8 +117,8 @@ fn H() -> i32 { // CHECK:STDOUT: %F.call.loc15: init %.3 = call %F.ref.loc15() to %.loc15 // CHECK:STDOUT: assign %v.ref, %F.call.loc15 // CHECK:STDOUT: %F.ref.loc16: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc13: ref %.3 = splice_block %return {} -// CHECK:STDOUT: %F.call.loc16: init %.3 = call %F.ref.loc16() to %.loc13 +// CHECK:STDOUT: %.loc13_8: ref %.3 = splice_block %return {} +// CHECK:STDOUT: %F.call.loc16: init %.3 = call %F.ref.loc16() to %.loc13_8 // CHECK:STDOUT: return %F.call.loc16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index b1ceed45d575..8a2bf661f109 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -50,28 +50,31 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] +// 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] // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.3] // CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_20, %.loc13_23) [template = constants.%.4] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32] +// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] // CHECK:STDOUT: %.loc13_25: type = array_type %int.sadd, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 211afc44f6b7..63ee8f2d5b85 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -42,20 +42,23 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1 +// 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: @Add.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 2192ac53a2c9..8cbb7b66dee1 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -75,116 +75,134 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // 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: %m.patt: i32 = binding_pattern m +// 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.loc11_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc11_6.2: i32 = bind_name n, %n.loc11_6.1 +// 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.loc11_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc11_14.2: i32 = bind_name m, %m.loc11_14.1 +// 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: } // CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// 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.loc19_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @A.%n: i32 = bind_name n, %n.loc19_6.1 +// 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.loc19_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: @A.%m: i32 = bind_name m, %m.loc19_14.1 +// 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: @A.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %m.patt: i32 = binding_pattern m +// 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.loc21_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc21_6.2: i32 = bind_name n, %n.loc21_6.1 +// 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.loc21_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc21_14.2: i32 = bind_name m, %m.loc21_14.1 +// 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: } // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// 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.loc29_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @B.%n: i32 = bind_name n, %n.loc29_6.1 +// 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.loc29_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: @B.%m: i32 = bind_name m, %m.loc29_14.1 +// 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: @B.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // 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: %m.patt: i32 = binding_pattern m +// 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.loc31_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc31_6.2: i32 = bind_name n, %n.loc31_6.1 +// 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.loc31_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc31_14.2: i32 = bind_name m, %m.loc31_14.1 +// 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: } // CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// 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.loc38_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @C.%n: i32 = bind_name n, %n.loc38_6.1 +// 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.loc38_14.1: i32 = param m, runtime_param1 -// CHECK:STDOUT: @C.%m: i32 = bind_name m, %m.loc38_14.1 +// 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: @C.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%n: i32, %m: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @A(%n.loc19: i32, %m.loc19: i32) -> i32 = "int.sadd" { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc19 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%n: i32, %m: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @B(%n.loc29: i32, %m.loc29: i32) -> i32 = "int.sadd" { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, file.%n.loc21_6.2 +// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%n: i32, %m: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @C(%n.loc38: i32, %m.loc38: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index 627faa2fcc51..926f5bb773af 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -40,7 +40,7 @@ fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {} +// CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UnknownBuiltin(); diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index b2529e62e2bd..002652841a48 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -63,23 +63,23 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] -// CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_16: i32 = int_literal 1 [template = constants.%.6] -// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, %I.decl [template = constants.%.1] -// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc12_40 [template = constants.%.4] -// CHECK:STDOUT: %.loc19_17.1: %F.type.1 = interface_witness_access @impl.%.loc15, element0 [template = constants.%F.2] +// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc12 [template = constants.%.4] +// CHECK:STDOUT: %.loc19_17.1: %F.type.1 = interface_witness_access @impl.%.loc15_15, element0 [template = constants.%F.2] // CHECK:STDOUT: %.loc19_17.2: = bound_method %.loc19_16, %.loc19_17.1 [template = constants.%.7] // CHECK:STDOUT: %.loc19_24: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %int.sadd: init i32 = call %.loc19_17.2(%.loc19_16, %.loc19_24) [template = constants.%.9] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32.loc19, %.loc19_11.1 [template = i32] +// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] // CHECK:STDOUT: %.loc19_26: type = array_type %int.sadd, i32 [template = constants.%.10] // CHECK:STDOUT: %arr.var: ref %.10 = var arr // CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var @@ -88,62 +88,68 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc12_8.1: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: @F.1.%Self (%Self) = bind_name self, %self.loc12_8.1 -// CHECK:STDOUT: %Self.ref.loc12_27: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %other.loc12_20.1: @F.1.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other.loc12_20.2: @F.1.%Self (%Self) = bind_name other, %other.loc12_20.1 -// CHECK:STDOUT: %Self.ref.loc12_36: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @F.1.%Self (%Self) = var +// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = 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: %.1 = 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: %.1 = 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: } -// CHECK:STDOUT: %.loc12_40: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc12_40 +// CHECK:STDOUT: .F = %.loc12 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { // 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: %other.patt: i32 = binding_pattern other +// 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.loc16_8.1: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_8.2: i32 = bind_name self, %self.loc16_8.1 +// 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.loc16_19.1: i32 = param other, runtime_param1 -// CHECK:STDOUT: %other.loc16_19.2: i32 = bind_name other, %other.loc16_19.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%F.decl) [template = constants.%.5] +// CHECK:STDOUT: %.loc15_15: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@I.%self.loc12_8.2: @F.1.%Self (%Self)](@I.%other.loc12_20.2: @F.1.%Self (%Self)) -> @F.1.%Self (%Self); +// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)](%other: @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[@impl.%self.loc16_8.2: i32](@impl.%other.loc16_19.2: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @F.2[%self: i32](%other: 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 adbb072fb2ba..4f9237f5071a 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 @@ -49,35 +49,38 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .Add = %Add.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { -// CHECK:STDOUT: @Int32.%return: ref type = var +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { +// CHECK:STDOUT: %return: ref type = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {} +// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self] // CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] { -// CHECK:STDOUT: %Self.ref.loc7_15: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc7_9.1: @Op.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_9.2: @Op.%Self (%Self) = bind_name self, %self.loc7_9.1 -// CHECK:STDOUT: %Self.ref.loc7_28: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %other.loc7_21.1: @Op.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other.loc7_21.2: @Op.%Self (%Self) = bind_name other, %other.loc7_21.1 -// CHECK:STDOUT: %Self.ref.loc7_37: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @Op.%Self (%Self) = var +// CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc7_15: %.2 = 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: %.2 = 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: %.2 = 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: } -// CHECK:STDOUT: %.loc7_41: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc7: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Op = %.loc7_41 +// CHECK:STDOUT: .Op = %.loc7 // CHECK:STDOUT: witness = (%Op.decl) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,7 +89,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: generic fn @Op(@Add.%Self: %.2) { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Add.%self.loc7_9.2: @Op.%Self (%Self)](@Add.%other.loc7_21.2: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { @@ -131,9 +134,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.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//default, inst+29, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+24, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//default, inst+31, loaded [template = constants.%.7] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -142,22 +145,22 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32] +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32, %.loc6_6.1 [template = i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5] // CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.4 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access @impl.%.loc6_22, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc10_18.2: = bound_method %.loc10_16, %.loc10_18.1 [template = constants.%.8] // CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18.2(%.loc10_16, %.loc10_20) [template = constants.%.9] -// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32.loc10, %.loc10_11.1 [template = i32] +// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32, %.loc10_11.1 [template = i32] // CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10] // CHECK:STDOUT: %arr.var: ref %.10 = var arr // CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var @@ -172,25 +175,28 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.2 { // 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: %other.patt: i32 = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, i32 [template = i32] -// CHECK:STDOUT: %self.loc7_9.1: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_9.2: i32 = bind_name self, %self.loc7_9.1 +// 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, i32 [template = i32] -// CHECK:STDOUT: %other.loc7_21.1: i32 = param other, runtime_param1 -// CHECK:STDOUT: %other.loc7_21.2: i32 = bind_name other, %other.loc7_21.1 +// 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, i32 [template = i32] -// CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6: = interface_witness (%Op.decl) [template = constants.%.3] +// CHECK:STDOUT: %.loc6_22: = interface_witness (%Op.decl) [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %.loc6 +// CHECK:STDOUT: witness = %.loc6_22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.%self.loc7_9.2: i32](@impl.%other.loc7_21.2: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Op.1[%self: i32](%other: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] @@ -205,7 +211,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %.loc10_32: i32 = int_literal 3 [template = constants.%.9] // CHECK:STDOUT: %.loc10_36: i32 = int_literal 4 [template = constants.%.12] // CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.4 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access @impl.%.loc6_22, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc10_34.2: = bound_method %.loc10_32, %.loc10_34.1 [template = constants.%.13] // CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34.2(%.loc10_32, %.loc10_36) [template = constants.%.14] // CHECK:STDOUT: %.loc10_37.1: %.15 = tuple_literal (%.loc10_26, %.loc10_29, %int.sadd) diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 827dfd83ead6..5a1d72eae907 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -36,24 +36,27 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .TestAdd = %TestAdd.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { -// CHECK:STDOUT: @Int32.%return: ref type = var +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { +// CHECK:STDOUT: %return: ref type = var // CHECK:STDOUT: } // CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc5_12.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @TestAdd.%a: i32 = bind_name a, %a.loc5_12.1 +// 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.loc5_20.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @TestAdd.%b: i32 = bind_name b, %b.loc5_20.1 +// 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: @TestAdd.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,7 +89,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+20, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+22, loaded [template = constants.%TestAdd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index d06212f045af..70adc236f6eb 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -48,7 +48,7 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 7803b1787959..003fdadd289f 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -106,27 +106,32 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {} +// 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: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_12.2: type = converted %int.make_type_32.loc12, %.loc12_12.1 [template = i32] -// CHECK:STDOUT: %a.loc12_9.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Run1.%a: i32 = bind_name a, %a.loc12_9.1 +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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: } // CHECK:STDOUT: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc13_9.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Run2.%a: i32 = bind_name a, %a.loc13_9.1 +// 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.loc13_17.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Run2.%b: i32 = bind_name b, %b.loc13_17.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run0() { diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 43d8c054fbad..5034966d4add 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -66,12 +66,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -82,13 +82,15 @@ fn F() { // CHECK:STDOUT: } // 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: } { // 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.loc11_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc11_6.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { 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 32a158996f5a..06c2a5f348e8 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -66,14 +66,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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -83,14 +83,14 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} { // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64] -// CHECK:STDOUT: @Foo.%return: ref f64 = var +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -116,8 +116,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() -> f64 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: f64 = float_literal 1 [template = constants.%.3] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_26: f64 = float_literal 1 [template = constants.%.3] +// CHECK:STDOUT: return %.loc11_26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 6dccbd5c190a..2cb5dd50a15b 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -52,17 +52,19 @@ fn Main() { // CHECK:STDOUT: } // 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: } { // 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.loc11_9.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Echo.%a: i32 = bind_name a, %a.loc11_9.1 +// 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: @Echo.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 2f6cf74db686..d5bd2eeba63f 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -57,18 +57,21 @@ fn Main() { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/function/call/no_prelude/alias.carbon b/toolchain/check/testdata/function/call/no_prelude/alias.carbon index 17513298f59f..83f9bd9d9f1b 100644 --- a/toolchain/check/testdata/function/call/no_prelude/alias.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/alias.carbon @@ -33,14 +33,14 @@ fn Main() { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { // CHECK:STDOUT: %.loc11_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @A.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %A.ref: %A.type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B: %A.type = bind_alias B, %A.decl [template = constants.%A] -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() -> %.1 { 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 c7f57e415bd1..982672b20fbb 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon @@ -34,15 +34,17 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { +// CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// 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.loc11_9.1: %.1 = param a, runtime_param0 -// CHECK:STDOUT: @Echo.%a: %.1 = bind_name a, %a.loc11_9.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: @Echo.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Echo(%a: %.1) -> %.1 { 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 917ac926aa50..e4d6e6676b9c 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon @@ -33,15 +33,17 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { +// CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// 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.loc11_9.1: %.1 = param a, runtime_param0 -// CHECK:STDOUT: @Echo.%a: %.1 = bind_name a, %a.loc11_9.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: @Echo.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Echo(%a: %.1) -> %.1 { diff --git a/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon b/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon index 9dc2240af600..db69331745e6 100644 --- a/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon @@ -29,8 +29,8 @@ fn Main() { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { diff --git a/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon b/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon index daab15b1412a..b0a855d8ebc1 100644 --- a/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon @@ -30,8 +30,8 @@ fn Main() { // CHECK:STDOUT: .MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple.decl // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %MakeImplicitEmptyTuple.decl: %MakeImplicitEmptyTuple.type = fn_decl @MakeImplicitEmptyTuple [template = constants.%MakeImplicitEmptyTuple] {} -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %MakeImplicitEmptyTuple.decl: %MakeImplicitEmptyTuple.type = fn_decl @MakeImplicitEmptyTuple [template = constants.%MakeImplicitEmptyTuple] {} {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeImplicitEmptyTuple() { diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index fd663b37adc0..da9543cf81a4 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -50,13 +50,15 @@ fn Main() { // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 5f5001b96aa6..e2745bad99f1 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -51,13 +51,15 @@ fn Main() { // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index b0e68ad29234..8a7fdb9aaade 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -51,18 +51,21 @@ fn Main() { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index b949c498ba8f..fec224cc3c90 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -52,18 +52,21 @@ fn Main() { // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; 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 05fd5897907a..a2b858d34383 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -45,16 +45,19 @@ 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 = binding_pattern n +// CHECK:STDOUT: %a.patt: = binding_pattern a +// 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.loc14_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @F.%n: i32 = bind_name n, %n.loc14_6.1 +// 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, @F.%n +// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %.loc14_25: type = ptr_type [template = ] -// CHECK:STDOUT: %a.loc14_14.1: = param a, runtime_param1 -// CHECK:STDOUT: @F.%a: = bind_name a, %a.loc14_14.1 +// CHECK:STDOUT: %a.param: = param a, runtime_param1 +// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 98dea5d443e2..b525f7717651 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -48,16 +48,19 @@ fn F(n: i32, n: 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.loc17_6: i32 = binding_pattern n +// CHECK:STDOUT: %n.patt.loc17_14: i32 = binding_pattern n +// 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.loc17_6.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @F.%n.loc17_6: i32 = bind_name n, %n.loc17_6.1 +// 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.loc17_14.1: i32 = param n, runtime_param1 -// CHECK:STDOUT: @F.%n.loc17_14: i32 = bind_name n, %n.loc17_14.1 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 737f219f212b..546126c756a9 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -301,37 +301,41 @@ import library "extern_api"; // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// 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: } { // 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.loc5_6.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1 +// 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: @B.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { +// CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// 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.loc6_6.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: @C.%c: %.3 = bind_name c, %c.loc6_6.1 +// 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: @C.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} +// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -392,37 +396,41 @@ import library "extern_api"; // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// 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: } { // 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.loc5_41.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_41.1 +// 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: @B.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { +// CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// 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.loc6_41.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: @C.%c: %.3 = bind_name c, %c.loc6_41.1 +// 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: @C.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} +// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); @@ -461,14 +469,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+21, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// 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: %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+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -587,14 +595,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+21, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// 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: %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+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -618,41 +626,41 @@ import library "extern_api"; // CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b.loc53 -// CHECK:STDOUT: .c = %c.loc54 +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// 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: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // 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.loc23_13.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc23_13.2: i32 = bind_name b, %b.loc23_13.1 +// 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.loc23: ref i32 = var +// CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { +// 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] // CHECK:STDOUT: %.loc32_21.1: %.2 = tuple_literal (%int.make_type_32.loc32_17) // 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.loc32_13.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c.loc32_13.2: %.3 = bind_name c, %c.loc32_13.1 +// 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.loc32: ref %.4 = var +// CHECK:STDOUT: %return.var: ref %.4 = var // 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] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: %.loc52_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -661,13 +669,13 @@ import library "extern_api"; // CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] // CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_32.loc53, %.loc53_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b.loc53: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: %int.make_type_32.loc54: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_32.loc54 [template = i32] // CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_32.loc54, %.loc54_13.1 [template = i32] // CHECK:STDOUT: %.loc54_16: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %c.var: ref %.4 = var c -// CHECK:STDOUT: %c.loc54: ref %.4 = bind_name c, %c.var +// CHECK:STDOUT: %c: ref %.4 = bind_name c, %c.var // CHECK:STDOUT: %.loc55_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %d.var: ref %.1 = var d @@ -682,9 +690,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.1: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.3) -> %.4; +// CHECK:STDOUT: fn @C(%c.1: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -741,14 +749,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+21, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+41, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// 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: %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+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+50, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -772,41 +780,41 @@ import library "extern_api"; // CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b.loc13 -// CHECK:STDOUT: .c = %c.loc14 +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// 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: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // 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.loc7_13.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc7_13.2: i32 = bind_name b, %b.loc7_13.1 +// 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.loc7: ref i32 = var +// CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { +// 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] // CHECK:STDOUT: %.loc8_21.1: %.2 = tuple_literal (%int.make_type_32.loc8_17) // 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.loc8_13.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c.loc8_13.2: %.3 = bind_name c, %c.loc8_13.1 +// 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.loc8: ref %.4 = var +// CHECK:STDOUT: %return.var: ref %.4 = var // 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] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: %.loc12_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -815,13 +823,13 @@ import library "extern_api"; // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b.loc13: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32] // CHECK:STDOUT: %.loc14_16: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %c.var: ref %.4 = var c -// CHECK:STDOUT: %c.loc14: ref %.4 = bind_name c, %c.var +// CHECK:STDOUT: %c: ref %.4 = bind_name c, %c.var // CHECK:STDOUT: %.loc15_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %d.var: ref %.1 = var d @@ -836,9 +844,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.1: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c: %.3) -> %.4; +// CHECK:STDOUT: extern fn @C(%c.1: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -894,19 +902,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+21, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// 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: %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+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, 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+21, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+41, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//extern_api, inst+48, 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.12 // CHECK:STDOUT: import Core//prelude @@ -1024,19 +1032,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+21, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+41, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// 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: %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+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+50, 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+21, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//api, inst+41, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//api, inst+48, 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.12 // CHECK:STDOUT: import Core//prelude @@ -1134,14 +1142,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+21, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+41, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// 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: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+50, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -1171,14 +1179,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+21, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+41, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// 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: %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+48, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+50, 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/export_name.carbon b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon index 0bd4c2bf2de7..52a8d0d5f7d0 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon @@ -50,7 +50,7 @@ var f: () = F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index 9127d3a9f329..bdd8be783a2c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -76,7 +76,7 @@ class C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -127,8 +127,8 @@ class C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -145,8 +145,8 @@ class C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -168,15 +168,17 @@ class C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.loc13_15.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_15.2: %C = bind_name self, %self.loc13_15.1 +// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -188,5 +190,5 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[@C.%self.loc13_15.2: %C](); +// CHECK:STDOUT: fn @G[%self: %C](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index 57a8a8f7b892..a44ba5d824fb 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -153,7 +153,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -175,7 +175,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -197,7 +197,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -219,7 +219,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -241,7 +241,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: .F = invalid // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -258,7 +258,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -289,7 +289,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -306,7 +306,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -323,7 +323,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -340,7 +340,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -362,7 +362,7 @@ extern library "extern_of_import" fn F(); // CHECK:STDOUT: .F = invalid // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index 391914e7f298..d8236c7e5273 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -49,7 +49,7 @@ extern fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -71,7 +71,7 @@ extern fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -93,7 +93,7 @@ extern fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index f2b013954b1b..21908fa627ab 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -47,7 +47,7 @@ extern fn F(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -69,7 +69,7 @@ extern fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -91,7 +91,7 @@ extern fn F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index b4fa3ac0bb60..fbd2f0fc8f92 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -113,26 +113,26 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: .ReturnDUsed = %ReturnDUsed.decl // CHECK:STDOUT: .Call = %Call.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl.loc5: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %ReturnCUnused.decl: %ReturnCUnused.type = fn_decl @ReturnCUnused [template = constants.%ReturnCUnused] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @ReturnCUnused.%return: ref %C = var +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl.loc5: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %ReturnCUnused.decl: %ReturnCUnused.type = fn_decl @ReturnCUnused [template = constants.%ReturnCUnused] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %ReturnCUsed.decl: %ReturnCUsed.type = fn_decl @ReturnCUsed [template = constants.%ReturnCUsed] { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @ReturnCUsed.%return: ref %C = var +// CHECK:STDOUT: %ReturnCUsed.decl: %ReturnCUsed.type = fn_decl @ReturnCUsed [template = constants.%ReturnCUsed] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %ReturnDUnused.decl: %ReturnDUnused.type = fn_decl @ReturnDUnused [template = constants.%ReturnDUnused] { -// CHECK:STDOUT: %D.ref.loc9: type = name_ref D, %D.decl.loc5 [template = constants.%D] -// CHECK:STDOUT: @ReturnDUnused.%return: ref %D = var +// CHECK:STDOUT: %ReturnDUnused.decl: %ReturnDUnused.type = fn_decl @ReturnDUnused [template = constants.%ReturnDUnused] {} { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl.loc5 [template = constants.%D] +// CHECK:STDOUT: %return: ref %D = var // CHECK:STDOUT: } -// CHECK:STDOUT: %ReturnDUsed.decl: %ReturnDUsed.type = fn_decl @ReturnDUsed [template = constants.%ReturnDUsed] { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, %D.decl.loc5 [template = constants.%D] -// CHECK:STDOUT: @ReturnDUsed.%return: ref %D = var +// CHECK:STDOUT: %ReturnDUsed.decl: %ReturnDUsed.type = fn_decl @ReturnDUsed [template = constants.%ReturnDUsed] {} { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl.loc5 [template = constants.%D] +// CHECK:STDOUT: %return: ref %D = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] {} -// CHECK:STDOUT: %D.decl.loc37: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] {} {} +// CHECK:STDOUT: %D.decl.loc37: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -205,7 +205,7 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {} +// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon index 2fefc1ee2180..ef65ac604138 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon @@ -120,13 +120,13 @@ extern private fn ExternOrderAndConflict() {} // CHECK:STDOUT: .ModifiersConflict2 = %ModifiersConflict2.decl // CHECK:STDOUT: .ExternOrderAndConflict = %ExternOrderAndConflict.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %WrongOrder.decl: %WrongOrder.type = fn_decl @WrongOrder [template = constants.%WrongOrder] {} -// CHECK:STDOUT: %DuplicateVirtual.decl: %DuplicateVirtual.type = fn_decl @DuplicateVirtual [template = constants.%DuplicateVirtual] {} -// CHECK:STDOUT: %TwoAccess.decl: %TwoAccess.type = fn_decl @TwoAccess [template = constants.%TwoAccess] {} -// CHECK:STDOUT: %ModifiersConflict.decl: %ModifiersConflict.type = fn_decl @ModifiersConflict [template = constants.%ModifiersConflict] {} -// CHECK:STDOUT: %InvalidModifier.decl: %InvalidModifier.type = fn_decl @InvalidModifier [template = constants.%InvalidModifier] {} -// CHECK:STDOUT: %ModifiersConflict2.decl: %ModifiersConflict2.type = fn_decl @ModifiersConflict2 [template = constants.%ModifiersConflict2] {} -// CHECK:STDOUT: %ExternOrderAndConflict.decl: %ExternOrderAndConflict.type = fn_decl @ExternOrderAndConflict [template = constants.%ExternOrderAndConflict] {} +// CHECK:STDOUT: %WrongOrder.decl: %WrongOrder.type = fn_decl @WrongOrder [template = constants.%WrongOrder] {} {} +// CHECK:STDOUT: %DuplicateVirtual.decl: %DuplicateVirtual.type = fn_decl @DuplicateVirtual [template = constants.%DuplicateVirtual] {} {} +// CHECK:STDOUT: %TwoAccess.decl: %TwoAccess.type = fn_decl @TwoAccess [template = constants.%TwoAccess] {} {} +// CHECK:STDOUT: %ModifiersConflict.decl: %ModifiersConflict.type = fn_decl @ModifiersConflict [template = constants.%ModifiersConflict] {} {} +// CHECK:STDOUT: %InvalidModifier.decl: %InvalidModifier.type = fn_decl @InvalidModifier [template = constants.%InvalidModifier] {} {} +// CHECK:STDOUT: %ModifiersConflict2.decl: %ModifiersConflict2.type = fn_decl @ModifiersConflict2 [template = constants.%ModifiersConflict2] {} {} +// CHECK:STDOUT: %ExternOrderAndConflict.decl: %ExternOrderAndConflict.type = fn_decl @ExternOrderAndConflict [template = constants.%ExternOrderAndConflict] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @WrongOrder(); 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 3442c278f47b..3243072ed1e3 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -83,36 +83,42 @@ fn E() {} // CHECK:STDOUT: .D = %D.decl.loc41 // CHECK:STDOUT: .E = %E.decl.loc51 // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] {} {} +// 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: } { // 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.loc21_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @B.%x: %.1 = bind_name x, %x.loc21_6.1 +// CHECK:STDOUT: %x.param.loc21: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc21: %.1 = bind_name x, %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: } { // 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.loc29_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc29_6.2: %.1 = bind_name x, %x.loc29_6.1 +// CHECK:STDOUT: %x.param.loc29: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc29: %.1 = bind_name x, %x.param.loc29 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} +// 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: } { // 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.loc39_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @.1.%x: %.1 = bind_name x, %x.loc39_6.1 +// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %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] {} -// CHECK:STDOUT: %E.decl.loc51: %E.type = fn_decl @E [template = constants.%E] {} -// CHECK:STDOUT: %E.decl.loc58: %E.type = fn_decl @E [template = constants.%E] {} +// 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] {} {} +// CHECK:STDOUT: %E.decl.loc51: %E.type = fn_decl @E [template = constants.%E] {} {} +// CHECK:STDOUT: %E.decl.loc58: %E.type = fn_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%x: %.1); +// CHECK:STDOUT: fn @B(%x.loc21: %.1); // CHECK:STDOUT: // CHECK:STDOUT: fn @C(); // CHECK:STDOUT: 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 d6b1fced5240..a512f7dda073 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 @@ -52,7 +52,7 @@ fn A => 0; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -69,7 +69,7 @@ fn A => 0; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -89,7 +89,7 @@ fn A => 0; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index 9d412b427cad..caa539be113c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -75,7 +75,7 @@ extern fn A(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -98,7 +98,7 @@ extern fn A(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -118,7 +118,7 @@ extern fn A(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); @@ -141,7 +141,7 @@ extern fn A(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); @@ -158,7 +158,7 @@ extern fn A(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -181,7 +181,7 @@ extern fn A(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index 6da5ee625bc5..c5b1a736243a 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -83,7 +83,7 @@ fn D(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -106,8 +106,8 @@ fn D(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl.loc4: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc4: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -147,7 +147,7 @@ fn D(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B(); @@ -178,7 +178,7 @@ fn D(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C(); @@ -201,7 +201,7 @@ fn D(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C(); @@ -226,7 +226,7 @@ fn D(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon b/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon index 24734bfd30bd..530b9193d30b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon @@ -27,8 +27,8 @@ fn G() { F(); } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index 01931ce90b51..ed0e9875de1b 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -47,18 +47,22 @@ fn G(a: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.loc11_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc11_6.1 +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13, %.loc13_9.1 [template = i32] -// CHECK:STDOUT: %a.loc13_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc13_6.1 +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index cfbec6fd98a0..4534e087bfa1 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -153,33 +153,37 @@ fn D() {} // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// 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: } { // 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.loc5_6.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1 +// 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: @B.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { +// CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// 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.loc6_6.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: @C.%c: %.3 = bind_name c, %c.loc6_6.1 +// 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: @C.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -235,7 +239,7 @@ fn D() {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); @@ -260,9 +264,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+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+56, unloaded +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -348,9 +352,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+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+56, unloaded +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -375,13 +379,13 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// 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: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // 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.loc23_6.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc23_6.2: i32 = bind_name b, %b.loc23_6.1 +// 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] @@ -396,7 +400,7 @@ 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.1: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_redecl_then_def.carbon // CHECK:STDOUT: @@ -427,8 +431,8 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %A.decl.loc14: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc24: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc14: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %A.decl.loc24: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A() { @@ -446,9 +450,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+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//fns, inst+56, loaded [template = constants.%D] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -471,8 +475,8 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %D.decl.loc15: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %D.decl.loc15: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D() { diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 7d86ef99a2c7..4b796e7904f0 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -162,7 +162,7 @@ private fn Redecl() {} // CHECK:STDOUT: .Def [private] = %Def.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Def.decl: %Def.type = fn_decl @Def [template = constants.%Def] {} +// CHECK:STDOUT: %Def.decl: %Def.type = fn_decl @Def [template = constants.%Def] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Def() { @@ -197,8 +197,8 @@ private fn Redecl() {} // CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %ForwardWithDef.decl.loc4: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} -// CHECK:STDOUT: %ForwardWithDef.decl.loc6: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc4: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc6: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ForwardWithDef() { @@ -233,7 +233,7 @@ private fn Redecl() {} // CHECK:STDOUT: .Forward [private] = %Forward.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} +// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Forward(); @@ -533,7 +533,7 @@ private fn Redecl() {} // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f // CHECK:STDOUT: %f: ref %.1 = bind_name f, %f.var -// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} +// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Forward() { @@ -659,8 +659,8 @@ private fn Redecl() {} // CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Redecl.decl.loc4: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} -// CHECK:STDOUT: %Redecl.decl.loc6: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} +// CHECK:STDOUT: %Redecl.decl.loc4: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} {} +// CHECK:STDOUT: %Redecl.decl.loc6: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Redecl() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index 1735da099dda..4241fbe3a7b1 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -122,7 +122,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -142,8 +142,8 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc5: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc5: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -163,7 +163,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -186,7 +186,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -206,8 +206,8 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -227,8 +227,8 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -248,9 +248,9 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc20: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc20: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -270,8 +270,8 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -299,7 +299,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index b269a1727ea9..29dfc83a8708 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -119,7 +119,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -136,7 +136,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -156,7 +156,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -173,7 +173,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -196,7 +196,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -216,7 +216,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -233,7 +233,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -256,7 +256,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -276,7 +276,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -312,7 +312,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { @@ -332,7 +332,7 @@ extern fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -361,7 +361,7 @@ extern fn F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F() { 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 94c5927477fc..dcf9c83ae300 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 @@ -106,51 +106,59 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: .J = %J.decl // CHECK:STDOUT: .K = %K.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// 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: } { // 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.loc19_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @.1.%x: %.1 = bind_name x, %x.loc19_6.1 +// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %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: } { // 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.loc21_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @G.%x: %.1 = bind_name x, %x.loc21_6.1 +// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc29: %.type.2 = fn_decl @.2 [template = constants.%.3] {} +// 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: } { // 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.loc31_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @H.%x: %.1 = bind_name x, %x.loc31_6.1 +// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc36: %.type.3 = fn_decl @.3 [template = constants.%.4] { -// CHECK:STDOUT: %x.loc36_6.1: = param x, runtime_param0 -// CHECK:STDOUT: @.3.%x: = bind_name x, %x.loc36_6.1 +// CHECK:STDOUT: %x.patt: = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %x.param: = param x, runtime_param0 +// CHECK:STDOUT: %x: = bind_name x, %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] { +// CHECK:STDOUT: %I.decl: %I.type = fn_decl @I [template = constants.%I] {} {} +// CHECK:STDOUT: %.decl.loc46: %.type.4 = fn_decl @.4 [template = constants.%.5] {} { // CHECK:STDOUT: %.loc46_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc46_12.2: type = converted %.loc46_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @.4.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] { +// CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] {} { // CHECK:STDOUT: %.loc48_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc48_12.2: type = converted %.loc48_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @J.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc56: %.type.5 = fn_decl @.5 [template = constants.%.6] {} -// CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] { +// CHECK:STDOUT: %.decl.loc56: %.type.5 = fn_decl @.5 [template = constants.%.6] {} {} +// CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] {} { // CHECK:STDOUT: %.loc58_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc58_12.2: type = converted %.loc58_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @K.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc65: %.type.6 = fn_decl @.6 [template = constants.%.8] { +// CHECK:STDOUT: %.decl.loc65: %.type.6 = fn_decl @.6 [template = constants.%.8] {} { // CHECK:STDOUT: %.loc65_12.1: %.7 = struct_literal () // CHECK:STDOUT: %.loc65_12.2: type = converted %.loc65_12.1, constants.%.7 [template = constants.%.7] -// CHECK:STDOUT: @.6.%return: ref %.7 = var +// CHECK:STDOUT: %return: ref %.7 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index 339dec854d2c..82cfa1e6e626 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -29,8 +29,8 @@ fn F() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl.loc11 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl.loc11: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %F.decl.loc18: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl.loc11: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %F.decl.loc18: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon b/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon index 60c1e60479f6..66bca2768516 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon @@ -24,8 +24,8 @@ fn Foo() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl.loc11 // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl.loc11: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} -// CHECK:STDOUT: %Foo.decl.loc13: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl.loc11: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} +// CHECK:STDOUT: %Foo.decl.loc13: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 4d68ac39194b..26fc4af81ac0 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -132,7 +132,7 @@ fn B() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -155,7 +155,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -175,7 +175,7 @@ fn B() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); @@ -198,7 +198,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A() { @@ -218,7 +218,7 @@ fn B() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -241,7 +241,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -261,7 +261,7 @@ fn B() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -287,7 +287,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -304,7 +304,7 @@ fn B() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -330,7 +330,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -351,7 +351,7 @@ fn B() {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %A.ref: %A.type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B: %A.type = bind_alias B, %A.decl [template = constants.%A] // CHECK:STDOUT: } @@ -380,7 +380,7 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/order.carbon b/toolchain/check/testdata/function/definition/no_prelude/order.carbon index 1eb52a4558f9..0665b3fb274d 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/order.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/order.carbon @@ -30,9 +30,9 @@ fn Baz() {} // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: .Baz = %Baz.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} -// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} -// CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} +// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} {} +// CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon b/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon index ff33bf5b4ace..99852769c3f5 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon @@ -22,7 +22,7 @@ fn Foo() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { 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 3361512a883b..62f372899a5a 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -189,28 +189,36 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Foo = %Foo.decl.loc7 // CHECK:STDOUT: .Bar = %Bar.decl.loc10 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc7_8.2: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc8_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc8_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = fn_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc10_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc10_8.2: %C = bind_name a, %a.loc10_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = fn_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc11_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Bar.%a: %C = bind_name a, %a.loc11_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,12 +229,12 @@ 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.loc8: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Bar(%a: %C) { +// CHECK:STDOUT: fn @Bar(%a.loc11: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -248,16 +256,20 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_14.1: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc6_14.2: %C = bind_name a, %a.loc6_14.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_10.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_10.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -268,7 +280,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.loc7: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -292,16 +304,20 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc14_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc14_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -336,16 +352,20 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc6_8.2: %C = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -356,7 +376,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.loc7: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -381,18 +401,22 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc8_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Bar.%a: %C = bind_name a, %a.loc8_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -424,8 +448,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+11, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+18, loaded [template = constants.%Bar] +// 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.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -439,14 +463,18 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %default.import.loc2_6.1 = import // 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: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.loc4_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc4_8.1 +// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %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: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.loc5_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Bar.%a: %C = bind_name a, %a.loc5_8.1 +// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -485,18 +513,22 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %b.loc15_8.1: %C = param b, runtime_param0 -// CHECK:STDOUT: @.1.%b: %C = bind_name b, %b.loc15_8.1 +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -534,18 +566,22 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc15_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -583,18 +619,22 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc15_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -631,16 +671,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl.loc7 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var.loc7: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: @Foo.%return: ref %C = var +// CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -675,11 +715,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -706,7 +748,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+9, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+10, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -721,9 +763,11 @@ fn 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc6_8.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -757,19 +801,23 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = binding_pattern a +// 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.loc6_8.1: %.3 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %.3 = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.3 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = binding_pattern a +// 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.loc17_8.1: %.3 = param a, runtime_param0 -// CHECK:STDOUT: @.1.%a: %.3 = bind_name a, %a.loc17_8.1 +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.3 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index 665f1baf3193..7492ea2d3ebc 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -42,11 +42,13 @@ fn Foo(a: i32) {} // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 8f939fb28d45..1bdb4ea68fc8 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -42,11 +42,13 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index a9b95adbbe56..6e392ad099e1 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -42,16 +42,19 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 c08512b92e4e..5685d05968dc 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -42,16 +42,19 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: } // 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: %b.patt: i32 = binding_pattern b +// 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.loc11_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc11_8.1 +// 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.loc11_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 +// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 35ba7d73ee59..6d8cd959b9d7 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -160,26 +160,30 @@ 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.loc4_25.1: type = param T, runtime_param -// CHECK:STDOUT: @ExplicitGenericParam.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_25.1 [symbolic = @ExplicitGenericParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, @ExplicitGenericParam.%T.loc4 [symbolic = @ExplicitGenericParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = @ExplicitGenericParam.%.1 (constants.%.1)] -// CHECK:STDOUT: @ExplicitGenericParam.%return: ref @ExplicitGenericParam.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @ExplicitGenericParam.%.1 (%.1) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [template = constants.%CallExplicitGenericParam] { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_32, %.loc6_37.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] +// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_32.loc6, %.loc6_37.1 [template = i32] // CHECK:STDOUT: %.loc6_37.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: @CallExplicitGenericParam.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [template = constants.%CallExplicitGenericParamWithGenericArg] { -// CHECK:STDOUT: %T.loc10_43.1: type = param T, runtime_param -// CHECK:STDOUT: @CallExplicitGenericParamWithGenericArg.%T.loc10: type = bind_symbolic_name T 0, %T.loc10_43.1 [symbolic = @CallExplicitGenericParamWithGenericArg.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, @CallExplicitGenericParamWithGenericArg.%T.loc10 [symbolic = @CallExplicitGenericParamWithGenericArg.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc10_62: type = struct_type {.a: %T} [symbolic = @CallExplicitGenericParamWithGenericArg.%.1 (constants.%.4)] -// CHECK:STDOUT: %.loc10_63: type = ptr_type %.4 [symbolic = @CallExplicitGenericParamWithGenericArg.%.2 (constants.%.5)] -// CHECK:STDOUT: @CallExplicitGenericParamWithGenericArg.%return: ref @CallExplicitGenericParamWithGenericArg.%.2 (%.5) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc10_62: type = struct_type {.a: %T} [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.loc10_63: type = ptr_type %.4 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%.2 (%.5) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -195,9 +199,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallExplicitGenericParam() -> %.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_32, %.loc7_30.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_32.loc7, %.loc7_30.1 [template = i32] // CHECK:STDOUT: %ExplicitGenericParam.call: init %.3 = call %ExplicitGenericParam.ref() // CHECK:STDOUT: %.loc7_35.1: %.3 = value_of_initializer %ExplicitGenericParam.call // CHECK:STDOUT: %.loc7_35.2: %.3 = converted %ExplicitGenericParam.call, %.loc7_35.1 @@ -214,7 +218,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn(%T.loc10: type) -> @CallExplicitGenericParamWithGenericArg.%.2 (%.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc11_37: type = struct_type {.a: %T} [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%.2 (%.5) = call %ExplicitGenericParam.ref() // CHECK:STDOUT: %.loc11_39.1: @CallExplicitGenericParamWithGenericArg.%.2 (%.5) = value_of_initializer %ExplicitGenericParam.call @@ -285,28 +289,33 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: .CallExplicitAndAlsoDeduced = %CallExplicitAndAlsoDeduced.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// 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.loc6_27.1: type = param T, runtime_param -// CHECK:STDOUT: @ExplicitAndAlsoDeduced.%T.loc6: type = bind_symbolic_name T 0, %T.loc6_27.1 [symbolic = @ExplicitAndAlsoDeduced.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, @ExplicitAndAlsoDeduced.%T.loc6 [symbolic = @ExplicitAndAlsoDeduced.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc6_37.1: @ExplicitAndAlsoDeduced.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @ExplicitAndAlsoDeduced.%x: @ExplicitAndAlsoDeduced.%T.1 (%T) = bind_name x, %x.loc6_37.1 -// CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, @ExplicitAndAlsoDeduced.%T.loc6 [symbolic = @ExplicitAndAlsoDeduced.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc6: type = ptr_type %T [symbolic = @ExplicitAndAlsoDeduced.%.1 (constants.%.3)] -// CHECK:STDOUT: @ExplicitAndAlsoDeduced.%return: ref @ExplicitAndAlsoDeduced.%.1 (%.3) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @ExplicitAndAlsoDeduced.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc6: type = ptr_type %T [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%.1 (%.3) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [template = constants.%CallExplicitAndAlsoDeduced] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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.loc9_31.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @CallExplicitAndAlsoDeduced.%n: i32 = bind_name n, %n.loc9_31.1 +// 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: @CallExplicitAndAlsoDeduced.%return: ref %.5 = var +// CHECK:STDOUT: %return: ref %.5 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -377,26 +386,31 @@ 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.loc4_25.1: type = param T, runtime_param -// CHECK:STDOUT: @ImplicitGenericParam.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_25.1 [symbolic = @ImplicitGenericParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, @ImplicitGenericParam.%T.loc4 [symbolic = @ImplicitGenericParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc4_35.1: @ImplicitGenericParam.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @ImplicitGenericParam.%x: @ImplicitGenericParam.%T.1 (%T) = bind_name x, %x.loc4_35.1 -// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, @ImplicitGenericParam.%T.loc4 [symbolic = @ImplicitGenericParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = @ImplicitGenericParam.%.1 (constants.%.1)] -// CHECK:STDOUT: @ImplicitGenericParam.%return: ref @ImplicitGenericParam.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @ImplicitGenericParam.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @ImplicitGenericParam.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @ImplicitGenericParam.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [template = constants.%CallImplicitGenericParam] { +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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.loc6_29.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @CallImplicitGenericParam.%n: i32 = bind_name n, %n.loc6_29.1 +// 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.%.3] -// CHECK:STDOUT: @CallImplicitGenericParam.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -478,30 +492,36 @@ 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.loc4_15.1: type = param T, runtime_param -// CHECK:STDOUT: @TupleParam.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @TupleParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, @TupleParam.%T.loc4 [symbolic = @TupleParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_35.1: %.2 = tuple_literal (%T.ref.loc4, %int.make_type_32.loc4) -// CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_32.loc4, %.loc4_35.2 [template = i32] -// CHECK:STDOUT: %.loc4_35.4: type = converted %.loc4_35.1, constants.%.3 [symbolic = @TupleParam.%.1 (constants.%.3)] -// CHECK:STDOUT: %x.loc4_25.1: @TupleParam.%.1 (%.3) = param x, runtime_param0 -// CHECK:STDOUT: @TupleParam.%x: @TupleParam.%.1 (%.3) = bind_name x, %x.loc4_25.1 +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @TupleParam.%.1 (%.3) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (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 = %.1 (constants.%.3)] +// CHECK:STDOUT: %x.param: @TupleParam.%.1 (%.3) = param x, runtime_param0 +// CHECK:STDOUT: %x: @TupleParam.%.1 (%.3) = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [template = constants.%CallTupleParam] {} +// CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [template = constants.%CallTupleParam] {} {} // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [template = constants.%StructParam] { -// CHECK:STDOUT: %T.loc17_16.1: type = param T, runtime_param -// CHECK:STDOUT: @StructParam.%T.loc17: type = bind_symbolic_name T 0, %T.loc17_16.1 [symbolic = @StructParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc17: type = name_ref T, @StructParam.%T.loc17 [symbolic = @StructParam.%T.1 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_41.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_41.2: type = converted %int.make_type_32.loc17, %.loc17_41.1 [template = i32] -// CHECK:STDOUT: %.loc17_44: type = struct_type {.a: %T, .b: i32} [symbolic = @StructParam.%.1 (constants.%.7)] -// CHECK:STDOUT: %x.loc17_26.1: @StructParam.%.1 (%.7) = param x, runtime_param0 -// CHECK:STDOUT: @StructParam.%x: @StructParam.%.1 (%.7) = bind_name x, %x.loc17_26.1 +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @StructParam.%.1 (%.7) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc17: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc17 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc17_41.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc17_41.2: type = converted %int.make_type_32, %.loc17_41.1 [template = i32] +// CHECK:STDOUT: %.loc17_44: type = struct_type {.a: %T, .b: i32} [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %x.param: @StructParam.%.1 (%.7) = param x, runtime_param0 +// CHECK:STDOUT: %x: @StructParam.%.1 (%.7) = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} +// CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -582,17 +602,21 @@ 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.loc6_25.1: type = param T, runtime_param -// CHECK:STDOUT: @ImplicitNotDeducible.%T.loc6: type = bind_symbolic_name T 0, %T.loc6_25.1 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: %U.loc6_35.1: type = param U, runtime_param -// CHECK:STDOUT: @ImplicitNotDeducible.%U.loc6: type = bind_symbolic_name U 1, %U.loc6_35.1 [symbolic = @ImplicitNotDeducible.%U.1 (constants.%U)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitNotDeducible.%T.loc6 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc6_45.1: @ImplicitNotDeducible.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @ImplicitNotDeducible.%x: @ImplicitNotDeducible.%T.1 (%T) = bind_name x, %x.loc6_45.1 -// CHECK:STDOUT: %U.ref: type = name_ref U, @ImplicitNotDeducible.%U.loc6 [symbolic = @ImplicitNotDeducible.%U.1 (constants.%U)] -// CHECK:STDOUT: @ImplicitNotDeducible.%return: ref @ImplicitNotDeducible.%U.1 (%U) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 1 +// CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc6: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.1 (%U) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} +// CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc6: type, %U.loc6: type) { @@ -649,18 +673,22 @@ 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.loc4_25.1: type = param T, runtime_param -// CHECK:STDOUT: @ImplicitNotDeducible.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_25.1 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, @ImplicitNotDeducible.%T.loc4 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc4_35.1: @ImplicitNotDeducible.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @ImplicitNotDeducible.%x: @ImplicitNotDeducible.%T.1 (%T) = bind_name x, %x.loc4_35.1 -// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, @ImplicitNotDeducible.%T.loc4 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: %y.loc4_41.1: @ImplicitNotDeducible.%T.1 (%T) = param y, runtime_param1 -// CHECK:STDOUT: @ImplicitNotDeducible.%y: @ImplicitNotDeducible.%T.1 (%T) = bind_name y, %y.loc4_41.1 -// CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, @ImplicitNotDeducible.%T.loc4 [symbolic = @ImplicitNotDeducible.%T.1 (constants.%T)] -// CHECK:STDOUT: @ImplicitNotDeducible.%return: ref @ImplicitNotDeducible.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: %y.patt: @ImplicitNotDeducible.%T.1 (%T) = binding_pattern y +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.1 (%T) = param y, runtime_param1 +// CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.1 (%T) = bind_name y, %y.param +// CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.1 (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} +// CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc4: type) { 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 5ee0d3109752..266b734ecc1e 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 @@ -46,19 +46,22 @@ 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: %a.patt: = binding_pattern a +// 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.loc14_6.1: i32 = param N, runtime_param -// CHECK:STDOUT: @F.%N.loc14: i32 = bind_symbolic_name N 0, %N.loc14_6.1 [symbolic = @F.%N.1 (constants.%N)] +// CHECK:STDOUT: %N.param: i32 = param N, runtime_param +// CHECK:STDOUT: %N.loc14: i32 = bind_symbolic_name N 0, %N.param [symbolic = %N.1 (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, @F.%N.loc14 [symbolic = @F.%N.1 (constants.%N)] +// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14 [symbolic = %N.1 (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.loc14_15.1: = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: = bind_name a, %a.loc14_15.1 +// CHECK:STDOUT: %a.param: = param a, runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // 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 9fbb78680aa0..915e30579d91 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -81,41 +81,52 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: @Function.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, @Function.%T.loc4 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc4_23.1: @Function.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @Function.%x: @Function.%T.1 (%T) = bind_name x, %x.loc4_23.1 -// CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, @Function.%T.loc4 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: @Function.%return: ref @Function.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @Function.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @Function.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @Function.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @Function.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [template = constants.%CallGeneric] { -// CHECK:STDOUT: %T.loc8_16.1: type = param T, runtime_param -// CHECK:STDOUT: @CallGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_16.1 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, @CallGeneric.%T.loc8 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc8_26.1: @CallGeneric.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @CallGeneric.%x: @CallGeneric.%T.1 (%T) = bind_name x, %x.loc8_26.1 -// CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, @CallGeneric.%T.loc8 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: @CallGeneric.%return: ref @CallGeneric.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @CallGeneric.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @CallGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @CallGeneric.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @CallGeneric.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericPtr.decl: %CallGenericPtr.type = fn_decl @CallGenericPtr [template = constants.%CallGenericPtr] { -// CHECK:STDOUT: %T.loc12_19.1: type = param T, runtime_param -// CHECK:STDOUT: @CallGenericPtr.%T.loc12: type = bind_symbolic_name T 0, %T.loc12_19.1 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, @CallGenericPtr.%T.loc12 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc12_33: type = ptr_type %T [symbolic = @CallGenericPtr.%.1 (constants.%.2)] -// CHECK:STDOUT: %x.loc12_29.1: @CallGenericPtr.%.1 (%.2) = param x, runtime_param0 -// CHECK:STDOUT: @CallGenericPtr.%x: @CallGenericPtr.%.1 (%.2) = bind_name x, %x.loc12_29.1 -// CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, @CallGenericPtr.%T.loc12 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = @CallGenericPtr.%.1 (constants.%.2)] -// CHECK:STDOUT: @CallGenericPtr.%return: ref @CallGenericPtr.%.1 (%.2) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @CallGenericPtr.%.1 (%.2) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc12_33: type = ptr_type %T [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %x.param: @CallGenericPtr.%.1 (%.2) = param x, runtime_param0 +// CHECK:STDOUT: %x: @CallGenericPtr.%.1 (%.2) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %return: ref @CallGenericPtr.%.1 (%.2) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc18_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %x.loc18_17.1: %C = param x, runtime_param0 -// CHECK:STDOUT: @CallSpecific.%x: %C = bind_name x, %x.loc18_17.1 -// CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @CallSpecific.%return: ref %C = var +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -146,7 +157,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: fn(%T.loc8: type, %x: @CallGeneric.%T.1 (%T)) -> @CallGeneric.%T.1 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %x.ref: @CallGeneric.%T.1 (%T) = name_ref x, %x // CHECK:STDOUT: %Function.call: init @CallGeneric.%T.1 (%T) = call %Function.ref(%x.ref) // CHECK:STDOUT: %.loc9_24.1: @CallGeneric.%T.1 (%T) = value_of_initializer %Function.call @@ -164,7 +175,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: fn(%T.loc12: type, %x: @CallGenericPtr.%.1 (%.2)) -> @CallGenericPtr.%.1 (%.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc13_20: type = ptr_type %T [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %x.ref: @CallGenericPtr.%.1 (%.2) = name_ref x, %x // CHECK:STDOUT: %Function.call: init @CallGenericPtr.%.1 (%.2) = call %Function.ref(%x.ref) @@ -177,7 +188,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: fn @CallSpecific(%x: %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: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.ref: %C = name_ref x, %x // CHECK:STDOUT: %.loc18: ref %C = splice_block %return {} // CHECK:STDOUT: %Function.call: init %C = call %Function.ref(%x.ref) to %.loc18 @@ -234,41 +245,52 @@ 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.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: @Function.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, @Function.%T.loc4 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc4_23.1: @Function.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @Function.%x: @Function.%T.1 (%T) = bind_name x, %x.loc4_23.1 -// CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, @Function.%T.loc4 [symbolic = @Function.%T.1 (constants.%T)] -// CHECK:STDOUT: @Function.%return: ref @Function.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @Function.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @Function.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @Function.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @Function.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [template = constants.%CallGeneric] { -// CHECK:STDOUT: %T.loc8_16.1: type = param T, runtime_param -// CHECK:STDOUT: @CallGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_16.1 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, @CallGeneric.%T.loc8 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc8_26.1: @CallGeneric.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @CallGeneric.%x: @CallGeneric.%T.1 (%T) = bind_name x, %x.loc8_26.1 -// CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, @CallGeneric.%T.loc8 [symbolic = @CallGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: @CallGeneric.%return: ref @CallGeneric.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @CallGeneric.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @CallGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @CallGeneric.%T.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @CallGeneric.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericPtr.decl: %CallGenericPtr.type = fn_decl @CallGenericPtr [template = constants.%CallGenericPtr] { -// CHECK:STDOUT: %T.loc12_19.1: type = param T, runtime_param -// CHECK:STDOUT: @CallGenericPtr.%T.loc12: type = bind_symbolic_name T 0, %T.loc12_19.1 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, @CallGenericPtr.%T.loc12 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc12_33: type = ptr_type %T [symbolic = @CallGenericPtr.%.1 (constants.%.2)] -// CHECK:STDOUT: %x.loc12_29.1: @CallGenericPtr.%.1 (%.2) = param x, runtime_param0 -// CHECK:STDOUT: @CallGenericPtr.%x: @CallGenericPtr.%.1 (%.2) = bind_name x, %x.loc12_29.1 -// CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, @CallGenericPtr.%T.loc12 [symbolic = @CallGenericPtr.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = @CallGenericPtr.%.1 (constants.%.2)] -// CHECK:STDOUT: @CallGenericPtr.%return: ref @CallGenericPtr.%.1 (%.2) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @CallGenericPtr.%.1 (%.2) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc12_33: type = ptr_type %T [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %x.param: @CallGenericPtr.%.1 (%.2) = param x, runtime_param0 +// CHECK:STDOUT: %x: @CallGenericPtr.%.1 (%.2) = bind_name x, %x.param +// CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %return: ref @CallGenericPtr.%.1 (%.2) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc18_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %x.loc18_17.1: %C = param x, runtime_param0 -// CHECK:STDOUT: @CallSpecific.%x: %C = bind_name x, %x.loc18_17.1 -// CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @CallSpecific.%return: ref %C = var +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// 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: } // CHECK:STDOUT: } // 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 cb0fb9748116..722cee31ea1b 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 @@ -32,10 +32,13 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %U.loc11_16.1: type = param U, runtime_param -// CHECK:STDOUT: @F.%U.loc11: type = bind_symbolic_name U 1, %U.loc11_16.1 [symbolic = @F.%U.1 (constants.%U)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc11: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // 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 bb24f7b0155c..f5a44fbc02da 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon @@ -24,8 +24,10 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // 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 9219af68f8a8..8981ab0af77b 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 @@ -28,16 +28,19 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, @F.%T.loc11 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc11_20: type = ptr_type %T [symbolic = @F.%.1 (constants.%.1)] -// CHECK:STDOUT: %.loc11_21: type = ptr_type %.1 [symbolic = @F.%.2 (constants.%.2)] -// CHECK:STDOUT: %p.loc11_16.1: @F.%.2 (%.2) = param p, runtime_param0 -// CHECK:STDOUT: @F.%p: @F.%.2 (%.2) = bind_name p, %p.loc11_16.1 -// CHECK:STDOUT: %T.ref.loc11_27: type = name_ref T, @F.%T.loc11 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc11_28: type = ptr_type %T [symbolic = @F.%.1 (constants.%.1)] -// CHECK:STDOUT: @F.%return: ref @F.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %p.patt: @F.%.2 (%.2) = binding_pattern p +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc11_20: type = ptr_type %T [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %.loc11_21: type = ptr_type %.1 [symbolic = %.2 (constants.%.2)] +// CHECK:STDOUT: %p.param: @F.%.2 (%.2) = param p, runtime_param0 +// CHECK:STDOUT: %p: @F.%.2 (%.2) = bind_name p, %p.param +// CHECK:STDOUT: %T.ref.loc11_27: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc11_28: type = ptr_type %T [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @F.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 e8ff1b7c1c00..5e4f48f30d01 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon @@ -28,8 +28,10 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // 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 bd42cf1bb25c..6829fdb41d0e 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 @@ -27,13 +27,16 @@ 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.loc11_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, @F.%T.loc11 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %n.loc11_16.1: @F.%T.1 (%T) = param n, runtime_param0 -// CHECK:STDOUT: @F.%n: @F.%T.1 (%T) = bind_name n, %n.loc11_16.1 -// CHECK:STDOUT: %T.ref.loc11_25: type = name_ref T, @F.%T.loc11 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: @F.%return: ref @F.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %n.patt: @F.%T.1 (%T) = binding_pattern n +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %n.param: @F.%T.1 (%T) = param n, runtime_param0 +// CHECK:STDOUT: %n: @F.%T.1 (%T) = bind_name n, %n.param +// CHECK:STDOUT: %T.ref.loc11_25: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @F.%T.1 (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -44,7 +47,7 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.loc11: type, %n: @F.%T.1 (%T)) -> @F.%T.1 (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %n.ref: @F.%T.1 (%T) = name_ref n, %n // CHECK:STDOUT: %m: @F.%T.1 (%T) = bind_name m, %n.ref // CHECK:STDOUT: %m.ref: @F.%T.1 (%T) = name_ref m, %m diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index a59811e1b877..532ffedb0f11 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -119,22 +119,26 @@ 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.loc4_6.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %T.loc4_6.2 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = @F.%.1 (constants.%.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param.loc4: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: %return.var.loc4: ref @F.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.loc6_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc6: type = bind_symbolic_name T 0, %T.loc6_6.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @F.%T.loc6 [symbolic = constants.%T] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// 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: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_6.2: type) { +// CHECK:STDOUT: generic fn @F(%T.loc4: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.1: type = ptr_type @F.%T.1 (%T) [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: @@ -143,7 +147,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: fn(%T.loc6: 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: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %F.call: init @F.%.1 (%.1) = call %F.ref() // CHECK:STDOUT: %.loc7_14.1: @F.%.1 (%.1) = value_of_initializer %F.call // CHECK:STDOUT: %.loc7_14.2: @F.%.1 (%.1) = converted %F.call, %.loc7_14.1 @@ -190,22 +194,28 @@ 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.loc4_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %U.loc4_16.1: type = param U, runtime_param -// CHECK:STDOUT: @F.%U.loc4: type = bind_symbolic_name U 1, %U.loc4_16.1 [symbolic = @F.%U.1 (constants.%U)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @F.%T.loc4 [symbolic = @F.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = @F.%.1 (constants.%.1)] -// CHECK:STDOUT: @F.%return: ref @F.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 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 = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc4: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @F.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %T.loc13_6.1: type = param T, runtime_param -// CHECK:STDOUT: @.1.%T.loc13: type = bind_symbolic_name T 0, %T.loc13_6.1 [symbolic = @.1.%T.1 (constants.%T)] -// CHECK:STDOUT: %U.loc13_16.1: type = param U, runtime_param -// CHECK:STDOUT: @.1.%U.loc13: type = bind_symbolic_name U 1, %U.loc13_16.1 [symbolic = @.1.%U.1 (constants.%U)] -// CHECK:STDOUT: %U.ref: type = name_ref U, @.1.%U.loc13 [symbolic = @.1.%U.1 (constants.%U)] -// CHECK:STDOUT: %.loc13: type = ptr_type %U [symbolic = @.1.%.1 (constants.%.3)] -// CHECK:STDOUT: @.1.%return: ref @.1.%.1 (%.3) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc13: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc13: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %.loc13: type = ptr_type %U [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %return: ref @.1.%.1 (%.3) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -280,22 +290,28 @@ 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.loc4_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T.1)] -// CHECK:STDOUT: %U.loc4_16.1: type = param U, runtime_param -// CHECK:STDOUT: @F.%U.loc4: type = bind_symbolic_name U 1, %U.loc4_16.1 [symbolic = @F.%U.1 (constants.%U.1)] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, @F.%T.loc4 [symbolic = @F.%T.1 (constants.%T.1)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T.1 [symbolic = @F.%.1 (constants.%.1)] -// CHECK:STDOUT: @F.%return: ref @F.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 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 = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc4: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U.1)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T.1 [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @F.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %U.loc13_6.1: type = param U, runtime_param -// CHECK:STDOUT: @.1.%U.loc13: type = bind_symbolic_name U 0, %U.loc13_6.1 [symbolic = @.1.%U.1 (constants.%U.2)] -// CHECK:STDOUT: %T.loc13_16.1: type = param T, runtime_param -// CHECK:STDOUT: @.1.%T.loc13: type = bind_symbolic_name T 1, %T.loc13_16.1 [symbolic = @.1.%T.1 (constants.%T.2)] -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, @.1.%T.loc13 [symbolic = @.1.%T.1 (constants.%T.2)] -// CHECK:STDOUT: %.loc13: type = ptr_type %T.2 [symbolic = @.1.%.1 (constants.%.3)] -// CHECK:STDOUT: @.1.%return: ref @.1.%.1 (%.3) = var +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 0 +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc13: type = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U.2)] +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc13: type = bind_symbolic_name T 1, %T.param [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: %.loc13: type = ptr_type %T.2 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %return: ref @.1.%.1 (%.3) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -317,7 +333,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: fn(%U.loc13: type, %T.loc13: type) -> @.1.%.1 (%.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 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -370,22 +386,28 @@ 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.loc4_6.1: type = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T.1)] -// CHECK:STDOUT: %U.loc4_16.1: type = param U, runtime_param -// CHECK:STDOUT: @F.%U.loc4: type = bind_symbolic_name U 1, %U.loc4_16.1 [symbolic = @F.%U.1 (constants.%U.1)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @F.%T.loc4 [symbolic = @F.%T.1 (constants.%T.1)] -// CHECK:STDOUT: %.loc4: type = ptr_type %T.1 [symbolic = @F.%.1 (constants.%.1)] -// CHECK:STDOUT: @F.%return: ref @F.%.1 (%.1) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 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 = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc4: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U.1)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %.loc4: type = ptr_type %T.1 [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %return: ref @F.%.1 (%.1) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %U.loc13_6.1: type = param U, runtime_param -// CHECK:STDOUT: @.1.%U.loc13: type = bind_symbolic_name U 0, %U.loc13_6.1 [symbolic = @.1.%U.1 (constants.%U.2)] -// CHECK:STDOUT: %T.loc13_16.1: type = param T, runtime_param -// CHECK:STDOUT: @.1.%T.loc13: type = bind_symbolic_name T 1, %T.loc13_16.1 [symbolic = @.1.%T.1 (constants.%T.2)] -// CHECK:STDOUT: %U.ref: type = name_ref U, @.1.%U.loc13 [symbolic = @.1.%U.1 (constants.%U.2)] -// CHECK:STDOUT: %.loc13: type = ptr_type %U.2 [symbolic = @.1.%.1 (constants.%.3)] -// CHECK:STDOUT: @.1.%return: ref @.1.%.1 (%.3) = var +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 0 +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc13: type = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U.2)] +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc13: type = bind_symbolic_name T 1, %T.param [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13 [symbolic = %U.1 (constants.%U.2)] +// CHECK:STDOUT: %.loc13: type = ptr_type %U.2 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %return: ref @.1.%.1 (%.3) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 35a98df85976..1e9b56bd8937 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -81,24 +81,26 @@ 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.loc11_12.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_12.2: type = bind_symbolic_name T 0, %T.loc11_12.1 [symbolic = @Wrap.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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] {} +// 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: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Wrap(file.%T.loc11_12.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @Wrap(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T) [symbolic = %Make.type (constants.%Make.type.1)] +// CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T.1) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Wrap.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Make.decl: @Wrap.%Make.type (%Make.type.1) = fn_decl @Make [symbolic = %Make (constants.%Make.1)] { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_12.2 [symbolic = @Make.%T (constants.%T)] -// CHECK:STDOUT: %return.var: ref @Make.%T (%T) = var +// CHECK:STDOUT: %Make.decl: @Wrap.%Make.type (%Make.type.1) = fn_decl @Make [symbolic = @Wrap.%Make (constants.%Make.1)] {} { +// CHECK:STDOUT: %T.ref: type = name_ref T, @Wrap.%T.loc11 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @Make.%T (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -122,7 +124,7 @@ fn G() { // CHECK:STDOUT: .arr = %.loc15_18 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(file.%T.loc11_12.2: type) { +// CHECK:STDOUT: generic fn @Make(@Wrap.%T.loc11: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.%T (%T); @@ -173,19 +175,19 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Wrap(@Wrap.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Wrap(@Wrap.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.1 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.2 @@ -197,7 +199,7 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%.1) { -// CHECK:STDOUT: %T => constants.%.1 +// CHECK:STDOUT: %T.1 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.3 @@ -209,7 +211,7 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%C) { -// CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.1 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.4 diff --git a/toolchain/check/testdata/global/class_obj.carbon b/toolchain/check/testdata/global/class_obj.carbon index d4ce876eb495..e32d0292f988 100644 --- a/toolchain/check/testdata/global/class_obj.carbon +++ b/toolchain/check/testdata/global/class_obj.carbon @@ -42,7 +42,7 @@ var a: A = {}; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var diff --git a/toolchain/check/testdata/global/class_with_fun.carbon b/toolchain/check/testdata/global/class_with_fun.carbon index 68f803320152..8e69572eb865 100644 --- a/toolchain/check/testdata/global/class_with_fun.carbon +++ b/toolchain/check/testdata/global/class_with_fun.carbon @@ -49,12 +49,12 @@ var a: A = {}; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %ret_a.decl: %ret_a.type = fn_decl @ret_a [template = constants.%ret_a] { -// CHECK:STDOUT: %A.ref.loc12: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: @ret_a.%return: ref %A = var +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %ret_a.decl: %ret_a.type = fn_decl @ret_a [template = constants.%ret_a] {} { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %return: ref %A = var // CHECK:STDOUT: } -// CHECK:STDOUT: %A.ref.loc16: type = name_ref A, %A.decl [template = constants.%A] +// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 9e837fc033f5..883be8f6dc8f 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -47,15 +47,15 @@ var a: i32 = test_a(); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %test_a.decl: %test_a.type = fn_decl @test_a [template = constants.%test_a] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32.loc11, %.loc11_16.1 [template = i32] -// CHECK:STDOUT: @test_a.%return: ref i32 = var +// CHECK:STDOUT: %test_a.decl: %test_a.type = fn_decl @test_a [template = constants.%test_a] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32, %.loc11_16.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 3b1e05d49efb..e814bb56a049 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -61,15 +61,17 @@ fn If(b: bool) { // CHECK:STDOUT: .If = %If.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// 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: %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: } { // 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.loc15_7.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If.%b: bool = bind_name b, %b.loc15_7.1 +// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 9e03eaee0e58..bea37e524b9e 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -83,37 +83,43 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %If1.decl: %If1.type = fn_decl @If1 [template = constants.%If1] { -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: %b.loc11_8.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If1.%b: bool = bind_name b, %b.loc11_8.1 -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32.loc11, %.loc11_20.1 [template = i32] -// CHECK:STDOUT: @If1.%return: ref i32 = var +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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: } // CHECK:STDOUT: %If2.decl: %If2.type = fn_decl @If2 [template = constants.%If2] { -// CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type.loc22 [template = bool] -// CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type.loc22, %.loc22_11.1 [template = bool] -// CHECK:STDOUT: %b.loc22_8.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If2.%b: bool = bind_name b, %b.loc22_8.1 -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32.loc22, %.loc22_20.1 [template = i32] -// CHECK:STDOUT: @If2.%return: ref i32 = var +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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: } // CHECK:STDOUT: %If3.decl: %If3.type = fn_decl @If3 [template = constants.%If3] { -// CHECK:STDOUT: %bool.make_type.loc33: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type.loc33 [template = bool] -// CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type.loc33, %.loc33_11.1 [template = bool] -// CHECK:STDOUT: %b.loc33_8.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If3.%b: bool = bind_name b, %b.loc33_8.1 -// CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_20.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] -// CHECK:STDOUT: %.loc33_20.2: type = converted %int.make_type_32.loc33, %.loc33_20.1 [template = i32] -// CHECK:STDOUT: @If3.%return: ref i32 = var +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 7095251f29fd..a77410f2ad20 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -56,15 +56,17 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc11_13.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @VarScope.%b: bool = bind_name b, %b.loc11_13.1 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32, %.loc11_25.1 [template = i32] -// CHECK:STDOUT: @VarScope.%return: ref i32 = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,9 +80,9 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32, %.loc13_12.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] +// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32.loc13, %.loc13_12.1 [template = i32] // CHECK:STDOUT: %n.var: ref i32 = var n // CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc13_18: i32 = int_literal 2 [template = constants.%.2] diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index 947e9d8e9b6c..2f3918b7fab8 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -55,14 +55,16 @@ fn If(b: bool) { // CHECK:STDOUT: .If = %If.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// 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: } { // 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.loc14_7.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If.%b: bool = bind_name b, %b.loc14_7.1 +// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index d533ae62c88b..676a78819970 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -55,15 +55,17 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc11_7.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @If.%b: bool = bind_name b, %b.loc11_7.1 +// 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: @If.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 8fca5de0bc75..56292c2003f3 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -55,25 +55,29 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: } // 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: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// 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.loc11_6.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc11_6.1 +// 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.loc11_15.1: i32 = param n, runtime_param1 -// CHECK:STDOUT: @F.%n: i32 = bind_name n, %n.loc11_15.1 +// 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.loc11_23.1: i32 = param m, runtime_param2 -// CHECK:STDOUT: @F.%m: i32 = bind_name m, %m.loc11_23.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -83,10 +87,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b: bool, %n: i32, %m: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// 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] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32, %.loc12_11.1 [template = i32] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] +// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] // CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16, i32 [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index c1850229ecd0..fb55a037b666 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -82,43 +82,45 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: .PartiallyConstant = %PartiallyConstant.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: @A.%return: ref i32 = var +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: @B.%return: ref i32 = var +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32, %.loc12_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_32.loc18, %.loc18_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_32, %.loc18_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] { +// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} { // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_18.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_18.2: type = converted %int.make_type_32.loc22, %.loc22_18.1 [template = i32] -// CHECK:STDOUT: @Constant.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %PartiallyConstant.decl: %PartiallyConstant.type = fn_decl @PartiallyConstant [template = constants.%PartiallyConstant] { -// CHECK:STDOUT: %t.loc28_22.1: type = param t, runtime_param0 -// CHECK:STDOUT: @PartiallyConstant.%t: type = bind_name t, %t.loc28_22.1 +// CHECK:STDOUT: %t.patt: type = binding_pattern t +// 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: @PartiallyConstant.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -126,14 +128,14 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @A() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: i32 = int_literal 2 [template = constants.%.3] -// CHECK:STDOUT: return %.loc12 +// CHECK:STDOUT: %.loc12_24: i32 = int_literal 2 [template = constants.%.3] +// CHECK:STDOUT: return %.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index e3bc9244c519..eca2fba1217c 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -58,28 +58,30 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: @A.%return: ref i32 = var +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: @B.%return: ref i32 = var +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32, %.loc12_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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.loc14_6.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc14_6.1 -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32.loc14, %.loc14_18.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -87,14 +89,14 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @A() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: i32 = int_literal 2 [template = constants.%.3] -// CHECK:STDOUT: return %.loc12 +// CHECK:STDOUT: %.loc12_24: i32 = int_literal 2 [template = constants.%.3] +// CHECK:STDOUT: return %.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; 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 061d4384f51c..fbffdd15bd13 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -82,7 +82,7 @@ class C { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 0bcdf3370d80..46a24958482f 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -76,11 +76,13 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: } // 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: } { // 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.loc4_27.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @ConditionIsNonConstant.%b: bool = bind_name b, %b.loc4_27.1 +// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -149,8 +151,10 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ChosenBranchIsNonConstant.decl: %ChosenBranchIsNonConstant.type = fn_decl @ChosenBranchIsNonConstant [template = constants.%ChosenBranchIsNonConstant] { -// CHECK:STDOUT: %t.loc4_30.1: type = param t, runtime_param0 -// CHECK:STDOUT: @ChosenBranchIsNonConstant.%t: type = bind_name t, %t.loc4_30.1 +// CHECK:STDOUT: %t.patt: type = binding_pattern t +// CHECK:STDOUT: } { +// CHECK:STDOUT: %t.param: type = param t, runtime_param0 +// CHECK:STDOUT: %t: type = bind_name t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index ae082feb0110..59a340efb135 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -52,25 +52,29 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: } // 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: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %c.patt: bool = binding_pattern c +// 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.loc11_6.1: bool = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: bool = bind_name a, %a.loc11_6.1 +// 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.loc11_15.1: bool = param b, runtime_param1 -// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc11_15.1 +// 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.loc11_24.1: bool = param c, runtime_param2 -// CHECK:STDOUT: @F.%c: bool = bind_name c, %c.loc11_24.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 63091dbe81f5..60a8bd4491b0 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -59,6 +59,8 @@ fn F(cond: bool) { // CHECK:STDOUT: } // 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: } { // 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] @@ -66,15 +68,17 @@ 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.loc11_6.1: %.2 = param s, runtime_param0 -// CHECK:STDOUT: @G.%s: %.2 = bind_name s, %s.loc11_6.1 +// CHECK:STDOUT: %s.param: %.2 = param s, runtime_param0 +// CHECK:STDOUT: %s: %.2 = bind_name s, %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: } { // 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.loc13_6.1: bool = param cond, runtime_param0 -// CHECK:STDOUT: @F.%cond: bool = bind_name cond, %cond.loc13_6.1 +// CHECK:STDOUT: %cond.param: bool = param cond, runtime_param0 +// CHECK:STDOUT: %cond: bool = bind_name cond, %cond.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 47095c05bc32..31584bb51e61 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -91,80 +91,92 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: .InstanceCallIndirect = %InstanceCallIndirect.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_32.loc16, %.loc16_6.1 [template = i32] -// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_32, %.loc16_6.1 [template = i32] +// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32.loc21, %.loc21_23.1 [template = i32] -// CHECK:STDOUT: %n.loc21_20.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @NonInstanceCall.%n: i32 = bind_name n, %n.loc21_20.1 +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_20.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_20.2: type = converted %int.make_type_32.loc25, %.loc25_20.1 [template = i32] -// CHECK:STDOUT: %n.loc25_17.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @InstanceCall.%n: i32 = bind_name n, %n.loc25_17.1 +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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: } // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [template = constants.%NonInstanceCallIndirect] { -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_34.2: type = converted %int.make_type_32.loc29, %.loc29_34.1 [template = i32] +// CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// 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.%.8] -// CHECK:STDOUT: %p.loc29_28.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @NonInstanceCallIndirect.%p: %.8 = bind_name p, %p.loc29_28.1 +// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCallIndirect.decl: %InstanceCallIndirect.type = fn_decl @InstanceCallIndirect [template = constants.%InstanceCallIndirect] { -// CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] -// CHECK:STDOUT: %.loc33_31.2: type = converted %int.make_type_32.loc33, %.loc33_31.1 [template = i32] +// CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// 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.%.8] -// CHECK:STDOUT: %p.loc33_25.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @InstanceCallIndirect.%p: %.8 = bind_name p, %p.loc33_25.1 +// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { -// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_14.1: type = facet_type_access %Self.ref [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref, %.loc13_14.1 [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc13_8.1: @G.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8.2: @G.1.%Self (%Self) = bind_name self, %self.loc13_8.1 +// CHECK:STDOUT: %self.patt: @G.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: %.1 = 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: } -// CHECK:STDOUT: %.loc13_21: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] +// CHECK:STDOUT: %.loc13: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %.loc12 -// CHECK:STDOUT: .G = %.loc13_21 +// CHECK:STDOUT: .G = %.loc13 // CHECK:STDOUT: witness = (%F.decl, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// 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: } { // 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.loc18_8.1: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_8.2: i32 = bind_name self, %self.loc18_8.1 +// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16: = interface_witness (%F.decl, %G.decl) [template = constants.%.7] +// CHECK:STDOUT: %.loc16_20: = interface_witness (%F.decl, %G.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %.loc16 +// CHECK:STDOUT: witness = %.loc16_20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) { @@ -175,21 +187,21 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Simple.%self.loc13_8.2: @G.1.%Self (%Self)](); +// CHECK:STDOUT: fn[%self: @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[@impl.%self.loc18_8.2: i32](); +// CHECK:STDOUT: fn @G.2[%self: i32](); // CHECK:STDOUT: // CHECK:STDOUT: fn @NonInstanceCall(%n: 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.%.1] // CHECK:STDOUT: %F.ref: %.3 = name_ref F, @Simple.%.loc12 [template = constants.%.4] -// CHECK:STDOUT: %.loc22: %F.type.1 = interface_witness_access @impl.%.loc16, element0 [template = constants.%F.2] +// CHECK:STDOUT: %.loc22: %F.type.1 = interface_witness_access @impl.%.loc16_20, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %.2 = call %.loc22() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,8 +210,8 @@ fn InstanceCallIndirect(p: 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.%.1] -// CHECK:STDOUT: %G.ref: %.5 = name_ref G, @Simple.%.loc13_21 [template = constants.%.6] -// CHECK:STDOUT: %.loc26_4.1: %G.type.1 = interface_witness_access @impl.%.loc16, element1 [template = constants.%G.2] +// CHECK:STDOUT: %G.ref: %.5 = name_ref G, @Simple.%.loc13 [template = constants.%.6] +// CHECK:STDOUT: %.loc26_4.1: %G.type.1 = interface_witness_access @impl.%.loc16_20, element1 [template = constants.%G.2] // CHECK:STDOUT: %.loc26_4.2: = bound_method %n.ref, %.loc26_4.1 // CHECK:STDOUT: %G.call: init %.2 = call %.loc26_4.2(%n.ref) // CHECK:STDOUT: return @@ -211,7 +223,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: %F.ref: %.3 = name_ref F, @Simple.%.loc12 [template = constants.%.4] // CHECK:STDOUT: %.loc30_4.1: ref i32 = deref %p.ref -// CHECK:STDOUT: %.loc30_4.2: %F.type.1 = interface_witness_access @impl.%.loc16, element0 [template = constants.%F.2] +// CHECK:STDOUT: %.loc30_4.2: %F.type.1 = interface_witness_access @impl.%.loc16_20, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %.2 = call %.loc30_4.2() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -220,9 +232,9 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] -// CHECK:STDOUT: %G.ref: %.5 = name_ref G, @Simple.%.loc13_21 [template = constants.%.6] +// CHECK:STDOUT: %G.ref: %.5 = name_ref G, @Simple.%.loc13 [template = constants.%.6] // CHECK:STDOUT: %.loc34_4.1: ref i32 = deref %p.ref -// CHECK:STDOUT: %.loc34_4.2: %G.type.1 = interface_witness_access @impl.%.loc16, element1 [template = constants.%G.2] +// CHECK:STDOUT: %.loc34_4.2: %G.type.1 = interface_witness_access @impl.%.loc16_20, element1 [template = constants.%G.2] // CHECK:STDOUT: %.loc34_4.3: = bound_method %.loc34_4.1, %.loc34_4.2 // CHECK:STDOUT: %.loc34_4.4: i32 = bind_value %.loc34_4.1 // CHECK:STDOUT: %G.call: init %.2 = call %.loc34_4.3(%.loc34_4.4) diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index 154e6f3ff428..cc79e8b3b742 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -43,12 +43,12 @@ impl i32 as I; // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32, %.loc13_6.1 [template = i32] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 4093e7ddc059..7a28e3a3bef3 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -46,12 +46,12 @@ impl i32 as Empty { // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_6.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_6.2: type = converted %int.make_type_32, %.loc14_6.1 [template = i32] -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -64,10 +64,10 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { -// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.3] +// CHECK:STDOUT: %.loc14_19: = interface_witness () [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc14 +// CHECK:STDOUT: witness = %.loc14_19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index 30a3c2fdf28c..d97466c64190 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -65,18 +65,20 @@ fn G(c: C) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} {} +// 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.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %c.loc21_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc21_6.1 +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -86,7 +88,7 @@ fn G(c: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc16: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -95,7 +97,7 @@ fn G(c: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.6 [template = constants.%.7] @@ -117,7 +119,7 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc22: %.3 = name_ref F, @HasF.%.loc12 [template = constants.%.4] // CHECK:STDOUT: %.loc22: %F.type.1 = interface_witness_access @impl.%.loc16, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc22: init %.2 = call %.loc22() diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 1924b5aa5803..49bc777db996 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -63,68 +63,74 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: .InstanceCall = %InstanceCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] -// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32.loc22, %.loc22_20.1 [template = i32] -// CHECK:STDOUT: %n.loc22_17.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @InstanceCall.%n: i32 = bind_name n, %n.loc22_17.1 +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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.ref: %.1 = name_ref Self, %Self [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %.loc12_14.1 [symbolic = @G.1.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc12_8.1: @G.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: @G.1.%Self (%Self) = bind_name self, %self.loc12_8.1 +// CHECK:STDOUT: %self.patt: @G.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: %.1 = 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: } -// CHECK:STDOUT: %.loc12_21: %.3 = assoc_entity element0, %G.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %G.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .G = %.loc12_21 +// CHECK:STDOUT: .G = %.loc12 // CHECK:STDOUT: witness = (%G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { +// CHECK:STDOUT: %self.patt: = binding_pattern self +// CHECK:STDOUT: } { // CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [template = ] -// CHECK:STDOUT: %self.loc19_8.1: = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_8.2: = bind_name self, %self.loc19_8.1 +// CHECK:STDOUT: %self.param: = param self, runtime_param0 +// CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness () [template = ] +// CHECK:STDOUT: %.loc15_20: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Simple.%self.loc12_8.2: @G.1.%Self (%Self)](); +// CHECK:STDOUT: fn[%self: @G.1.%Self (%Self)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[@impl.%self.loc19_8.2: ](); +// CHECK:STDOUT: fn @G.2[%self: ](); // CHECK:STDOUT: // CHECK:STDOUT: fn @InstanceCall(%n: 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.%.1] -// CHECK:STDOUT: %G.ref: %.3 = name_ref G, @Simple.%.loc12_21 [template = constants.%.4] -// CHECK:STDOUT: %.loc23_4.1: %G.type.1 = interface_witness_access @impl.%.loc15, element0 [template = ] +// CHECK:STDOUT: %G.ref: %.3 = name_ref G, @Simple.%.loc12 [template = constants.%.4] +// CHECK:STDOUT: %.loc23_4.1: %G.type.1 = interface_witness_access @impl.%.loc15_20, element0 [template = ] // CHECK:STDOUT: %.loc23_4.2: = bound_method %n.ref, %.loc23_4.1 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index facfcf2a9920..d5af31306ea9 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -63,29 +63,33 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type = interface_decl @GenericInterface [template = constants.%GenericInterface] { -// CHECK:STDOUT: %T.loc11_28.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T 0, %T.loc11_28.1 [symbolic = @GenericInterface.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @GenericInterface(file.%T.loc11_28.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @GenericInterface(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @GenericInterface, @GenericInterface(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @GenericInterface, @GenericInterface(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %F.type: type = fn_type @F.1, @GenericInterface(%T) [symbolic = %F.type (constants.%F.type.1)] +// CHECK:STDOUT: %F.type: type = fn_type @F.1, @GenericInterface(%T.1) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @GenericInterface.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: %.2: type = assoc_entity_type @GenericInterface.%.1 (%.2), @GenericInterface.%F.type (%F.type.1) [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: @GenericInterface.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @GenericInterface.%.1 (%.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 = %F (constants.%F.1)] { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_28.2 [symbolic = @F.1.%T (constants.%T)] -// CHECK:STDOUT: %x.loc12_8.1: @F.1.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc12_8.2: @F.1.%T (%T) = bind_name x, %x.loc12_8.1 +// 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: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, @GenericInterface.%T.loc11 [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: } // CHECK:STDOUT: %.loc12: @GenericInterface.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -98,24 +102,28 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %T.ref: type = name_ref T, @C.%T.loc19_23.2 [symbolic = @F.2.%T (constants.%T)] -// CHECK:STDOUT: %x.loc20_10.1: @F.2.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc20_10.2: @F.2.%T (%T) = bind_name x, %x.loc20_10.1 +// CHECK:STDOUT: %x.patt: @F.2.%T (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T [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: } -// CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.5] +// CHECK:STDOUT: %.loc19_56: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %.loc19 +// CHECK:STDOUT: witness = %.loc19_56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %T.loc19_23.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_23.2: type = bind_symbolic_name T 0, %T.loc19_23.1 [symbolic = constants.%T] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// 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: %GenericInterface.ref: %GenericInterface.type = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc19_23.2 [symbolic = constants.%T] -// CHECK:STDOUT: %.loc19: type = interface_type @GenericInterface, @GenericInterface(constants.%T) [symbolic = constants.%.2] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] +// CHECK:STDOUT: %.loc19_52: type = interface_type @GenericInterface, @GenericInterface(constants.%T) [symbolic = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: @@ -124,25 +132,25 @@ class C { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(file.%T.loc11_28.2: type, @GenericInterface.%Self.1: @GenericInterface.%.1 (%.2)) { +// CHECK:STDOUT: generic fn @F.1(@GenericInterface.%T.loc11: type, @GenericInterface.%Self.1: @GenericInterface.%.1 (%.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@GenericInterface.%x.loc12_8.2: @F.1.%T (%T)); +// CHECK:STDOUT: fn(%x: @F.1.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(@C.%T.loc19_23.2: type) { +// CHECK:STDOUT: generic fn @F.2(@impl.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(@impl.%x.loc20_10.2: @F.2.%T (%T)) { +// CHECK:STDOUT: fn(%x: @F.2.%T (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.2 @@ -157,8 +165,8 @@ class C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(@GenericInterface.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @GenericInterface(@GenericInterface.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index f0ef855d9347..ec760820df8d 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -47,12 +47,12 @@ extend impl i32 as I {} // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -65,10 +65,10 @@ extend impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { -// CHECK:STDOUT: %.loc16: = interface_witness () [template = constants.%.3] +// CHECK:STDOUT: %.loc16_22: = interface_witness () [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc16 +// CHECK:STDOUT: witness = %.loc16_22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 0d0b36259471..aebf273934a0 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -79,10 +79,10 @@ class E { // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %E.decl: type = class_decl @E [template = constants.%E] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %E.decl: type = class_decl @E [template = constants.%E] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -94,10 +94,10 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: i32 as %.1 { -// CHECK:STDOUT: %.loc18: = interface_witness () [template = constants.%.3] +// CHECK:STDOUT: %.loc18_24: = interface_witness () [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc18 +// CHECK:STDOUT: witness = %.loc18_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %D as %.1; @@ -110,7 +110,7 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl.1 { +// CHECK:STDOUT: impl_decl @impl.1 {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32] @@ -124,7 +124,7 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: impl_decl @impl.2 { +// CHECK:STDOUT: impl_decl @impl.2 {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } @@ -136,7 +136,7 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { -// CHECK:STDOUT: impl_decl @impl.3 { +// CHECK:STDOUT: impl_decl @impl.3 {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 4cd118390ecd..927fbc6dd400 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -47,15 +47,15 @@ class C { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as i32; // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_32, %.loc15_18.1 [template = i32] -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer @impl.%int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_18.2: type = converted @impl.%int.make_type_32, %.loc15_18.1 [template = i32] +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 04dfbceac483..4e4df169c813 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -50,12 +50,12 @@ interface I { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C.1] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C.1] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -69,7 +69,7 @@ interface I { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 843fcafbb282..d441f31111b8 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -49,8 +49,8 @@ class C { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I; @@ -58,7 +58,7 @@ class C { // CHECK:STDOUT: impl @impl: %C as %.1; // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: = complete_type_witness %.2 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 81d1ae79c907..a7a3d3ea1f86 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -53,15 +53,15 @@ impl as Simple { // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -71,7 +71,7 @@ impl as Simple { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc18: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index 07189f730557..612aaa65ceb8 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -48,12 +48,12 @@ impl bool as I {} // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_6.2: type = converted %bool.make_type, %.loc16_6.1 [template = bool] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // 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 97cfbd647e5a..269411c8c195 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -342,30 +342,30 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} -// CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} -// CHECK:STDOUT: %PossiblyF.decl: %PossiblyF.type = fn_decl @PossiblyF [template = constants.%PossiblyF] {} -// CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {} -// CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} -// CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} -// CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} -// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.7] {} -// CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} -// CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} -// CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} -// CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {} -// CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} -// CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} -// CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} -// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} -// CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} -// CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} {} +// CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} {} +// CHECK:STDOUT: %PossiblyF.decl: %PossiblyF.type = fn_decl @PossiblyF [template = constants.%PossiblyF] {} {} +// CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {} {} +// CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} {} +// CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} {} +// CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} {} +// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.7] {} {} +// CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} {} +// CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} {} +// CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} {} +// CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {} {} +// CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} {} +// CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} {} +// CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} {} +// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} {} +// CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} {} +// CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc11: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -377,59 +377,64 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: interface @J { // CHECK:STDOUT: %Self: %.7 = 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: %b.patt: bool = binding_pattern b +// 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.loc93_20.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc93_20.2: bool = bind_name self, %self.loc93_20.1 +// 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.loc93_32.1: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc93_32.2: bool = bind_name b, %b.loc93_32.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc93_48: %.8 = assoc_entity element0, %F.decl [template = constants.%.9] +// CHECK:STDOUT: %.loc93: %.8 = assoc_entity element0, %F.decl [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc93_48 +// CHECK:STDOUT: .F = %.loc93 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @SelfNested { // CHECK:STDOUT: %Self: %.10 = 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: %Self.ref.loc188_12: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = @F.13.%.1 (constants.%.11)] -// CHECK:STDOUT: %Self.ref.loc188_24: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = @F.13.%Self (constants.%Self.3)] +// CHECK:STDOUT: %x.patt: @F.13.%.3 (%.14) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc188_12: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self.ref.loc188_24: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_32, %.loc188_34.1 [template = i32] -// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = @F.13.%.2 (constants.%.12)] +// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: %.loc188_38.1: %.13 = tuple_literal (%.loc188_16.3, %.loc188_37) -// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.14 [symbolic = @F.13.%.3 (constants.%.14)] -// CHECK:STDOUT: %x.loc188_8.1: @F.13.%.3 (%.14) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc188_8.2: @F.13.%.3 (%.14) = bind_name x, %x.loc188_8.1 -// CHECK:STDOUT: %Self.ref.loc188_45: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.14 [symbolic = %.3 (constants.%.14)] +// CHECK:STDOUT: %x.param: @F.13.%.3 (%.14) = param x, runtime_param0 +// CHECK:STDOUT: %x: @F.13.%.3 (%.14) = bind_name x, %x.param +// CHECK:STDOUT: %Self.ref.loc188_45: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.15] -// CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = @F.13.%.4 (constants.%.16)] -// CHECK:STDOUT: %return.var: ref @F.13.%.4 (%.16) = var +// 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: type = array_type %.loc188_51, %Self.3 [symbolic = %.4 (constants.%.16)] +// CHECK:STDOUT: %return: ref @F.13.%.4 (%.16) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc188_53: %.17 = assoc_entity element0, %F.decl [template = constants.%.18] +// CHECK:STDOUT: %.loc188: %.17 = assoc_entity element0, %F.decl [template = constants.%.18] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc188_53 +// CHECK:STDOUT: .F = %.loc188 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -441,7 +446,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %FNotFunction as %.1 { -// CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc25: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -461,11 +466,13 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %FExtraParam as %.1 { // 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: } { // 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.loc62_10.1: bool = param b, runtime_param0 -// CHECK:STDOUT: %b.loc62_10.2: bool = bind_name b, %b.loc62_10.1 +// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc54: = interface_witness () [template = ] // CHECK:STDOUT: @@ -476,9 +483,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.5: %FExtraImplicitParam as %.1 { // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] -// CHECK:STDOUT: %self.loc75_10.1: %FExtraImplicitParam = param self, runtime_param0 -// CHECK:STDOUT: %self.loc75_10.2: %FExtraImplicitParam = bind_name self, %self.loc75_10.1 +// CHECK:STDOUT: %self.param: %FExtraImplicitParam = param self, runtime_param0 +// CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc67: = interface_witness () [template = ] // CHECK:STDOUT: @@ -488,11 +497,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.6: %FExtraReturnType as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.5] { +// CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.5] {} { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc89_15.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc89_15.2: type = converted %bool.make_type, %.loc89_15.1 [template = bool] -// CHECK:STDOUT: %return.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc81: = interface_witness () [template = ] // CHECK:STDOUT: @@ -503,15 +512,17 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.7: %FMissingParam as %.7 { // 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: } { // 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.loc104_10.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc104_10.2: bool = bind_name self, %self.loc104_10.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc96: = interface_witness () [template = ] // CHECK:STDOUT: @@ -522,15 +533,17 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.8: %FMissingImplicitParam as %.7 { // 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: } { // 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.loc117_10.1: bool = param b, runtime_param0 -// CHECK:STDOUT: %b.loc117_10.2: bool = bind_name b, %b.loc117_10.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc109: = interface_witness () [template = ] // CHECK:STDOUT: @@ -541,16 +554,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.9: %FMissingReturnType as %.7 { // 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: %b.patt: bool = binding_pattern b +// 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.loc130_10.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc130_10.2: bool = bind_name self, %self.loc130_10.1 +// 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.loc130_22.1: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc130_22.2: bool = bind_name b, %b.loc130_22.1 +// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc122: = interface_witness () [template = ] // CHECK:STDOUT: @@ -561,18 +577,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.10: %FDifferentParamType as %.7 { // 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: %b.patt: %FDifferentParamType = binding_pattern b +// 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.loc143_10.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc143_10.2: bool = bind_name self, %self.loc143_10.1 +// 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.loc143_22.1: %FDifferentParamType = param b, runtime_param1 -// CHECK:STDOUT: %b.loc143_22.2: %FDifferentParamType = bind_name b, %b.loc143_22.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc135: = interface_witness () [template = ] // CHECK:STDOUT: @@ -583,18 +602,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.11: %FDifferentImplicitParamType as %.7 { // 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: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] -// CHECK:STDOUT: %self.loc156_10.1: %FDifferentImplicitParamType = param self, runtime_param0 -// CHECK:STDOUT: %self.loc156_10.2: %FDifferentImplicitParamType = bind_name self, %self.loc156_10.1 +// 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.loc156_22.1: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc156_22.2: bool = bind_name b, %b.loc156_22.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc148: = interface_witness () [template = ] // CHECK:STDOUT: @@ -605,18 +627,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.12: %FDifferentReturnType as %.7 { // 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: %b.patt: bool = binding_pattern b +// 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.loc169_10.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc169_10.2: bool = bind_name self, %self.loc169_10.1 +// 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.loc169_22.1: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc169_22.2: bool = bind_name b, %b.loc169_22.1 +// 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.var: ref %FDifferentReturnType = var +// CHECK:STDOUT: %return: ref %FDifferentReturnType = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc161: = interface_witness () [template = ] // CHECK:STDOUT: @@ -627,20 +652,23 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.13: %FDifferentParamName as %.7 { // 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: %not_b.patt: bool = binding_pattern not_b +// 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.loc183_10.1: bool = param self, runtime_param0 -// CHECK:STDOUT: %self.loc183_10.2: bool = bind_name self, %self.loc183_10.1 +// 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.loc183_22.1: bool = param not_b, runtime_param1 -// CHECK:STDOUT: %not_b.loc183_22.2: bool = bind_name not_b, %not_b.loc183_22.1 +// 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.var: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc175: = interface_witness () [template = ] // CHECK:STDOUT: @@ -651,6 +679,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.14: %SelfNestedBadParam as %.10 { // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] { +// CHECK:STDOUT: %x.patt: %.21 = binding_pattern x +// 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.%.19] // CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32] @@ -662,12 +692,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.20] // CHECK:STDOUT: %.loc200_53.1: %.13 = tuple_literal (%.loc200_32, %.loc200_52) // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.21 [template = constants.%.21] -// CHECK:STDOUT: %x.loc200_10.1: %.21 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc200_10.2: %.21 = bind_name x, %x.loc200_10.1 +// CHECK:STDOUT: %x.param: %.21 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.21 = 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.%.15] // CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.22] -// CHECK:STDOUT: %return.var: ref %.22 = var +// CHECK:STDOUT: %return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc192: = interface_witness () [template = ] // CHECK:STDOUT: @@ -678,6 +708,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.15: %SelfNestedBadReturnType as %.10 { // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] { +// CHECK:STDOUT: %x.patt: %.27 = binding_pattern x +// 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.%.25] // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] @@ -687,12 +719,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.26] // CHECK:STDOUT: %.loc212_78.1: %.13 = tuple_literal (%.loc212_37, %.loc212_77) // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.27 [template = constants.%.27] -// CHECK:STDOUT: %x.loc212_10.1: %.27 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc212_10.2: %.27 = bind_name x, %x.loc212_10.1 +// CHECK:STDOUT: %x.param: %.27 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.27 = 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.%.15] // CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.22] -// CHECK:STDOUT: %return.var: ref %.22 = var +// CHECK:STDOUT: %return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc205: = interface_witness () [template = ] // CHECK:STDOUT: @@ -702,7 +734,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NoF { -// CHECK:STDOUT: impl_decl @impl.1 { +// CHECK:STDOUT: impl_decl @impl.1 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.5 [template = constants.%.6] @@ -712,7 +744,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FNotFunction { -// CHECK:STDOUT: impl_decl @impl.2 { +// CHECK:STDOUT: impl_decl @impl.2 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc35: = complete_type_witness %.5 [template = constants.%.6] @@ -724,7 +756,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: class @F.16; // CHECK:STDOUT: // CHECK:STDOUT: class @FAlias { -// CHECK:STDOUT: impl_decl @impl.3 { +// CHECK:STDOUT: impl_decl @impl.3 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc51: = complete_type_witness %.5 [template = constants.%.6] @@ -734,7 +766,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FExtraParam { -// CHECK:STDOUT: impl_decl @impl.4 { +// CHECK:STDOUT: impl_decl @impl.4 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc64: = complete_type_witness %.5 [template = constants.%.6] @@ -744,7 +776,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FExtraImplicitParam { -// CHECK:STDOUT: impl_decl @impl.5 { +// CHECK:STDOUT: impl_decl @impl.5 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc77: = complete_type_witness %.5 [template = constants.%.6] @@ -754,7 +786,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FExtraReturnType { -// CHECK:STDOUT: impl_decl @impl.6 { +// CHECK:STDOUT: impl_decl @impl.6 {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc91: = complete_type_witness %.5 [template = constants.%.6] @@ -764,7 +796,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingParam { -// CHECK:STDOUT: impl_decl @impl.7 { +// CHECK:STDOUT: impl_decl @impl.7 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc106: = complete_type_witness %.5 [template = constants.%.6] @@ -774,7 +806,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingImplicitParam { -// CHECK:STDOUT: impl_decl @impl.8 { +// CHECK:STDOUT: impl_decl @impl.8 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc119: = complete_type_witness %.5 [template = constants.%.6] @@ -784,7 +816,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingReturnType { -// CHECK:STDOUT: impl_decl @impl.9 { +// CHECK:STDOUT: impl_decl @impl.9 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc132: = complete_type_witness %.5 [template = constants.%.6] @@ -794,7 +826,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentParamType { -// CHECK:STDOUT: impl_decl @impl.10 { +// CHECK:STDOUT: impl_decl @impl.10 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc145: = complete_type_witness %.5 [template = constants.%.6] @@ -804,7 +836,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentImplicitParamType { -// CHECK:STDOUT: impl_decl @impl.11 { +// CHECK:STDOUT: impl_decl @impl.11 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc158: = complete_type_witness %.5 [template = constants.%.6] @@ -814,7 +846,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentReturnType { -// CHECK:STDOUT: impl_decl @impl.12 { +// CHECK:STDOUT: impl_decl @impl.12 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc171: = complete_type_witness %.5 [template = constants.%.6] @@ -824,7 +856,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentParamName { -// CHECK:STDOUT: impl_decl @impl.13 { +// CHECK:STDOUT: impl_decl @impl.13 {} { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc185: = complete_type_witness %.5 [template = constants.%.6] @@ -834,7 +866,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadParam { -// CHECK:STDOUT: impl_decl @impl.14 { +// CHECK:STDOUT: impl_decl @impl.14 {} { // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc202: = complete_type_witness %.5 [template = constants.%.6] @@ -844,7 +876,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadReturnType { -// CHECK:STDOUT: impl_decl @impl.15 { +// CHECK:STDOUT: impl_decl @impl.15 {} { // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc214: = complete_type_witness %.5 [template = constants.%.6] @@ -862,30 +894,30 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(@impl.4.%b.loc62_10.2: bool); +// CHECK:STDOUT: fn @F.2(%b: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[@impl.5.%self.loc75_10.2: %FExtraImplicitParam](); +// CHECK:STDOUT: fn @F.3[%self: %FExtraImplicitParam](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.4() -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.5(@J.%Self: %.7) { // CHECK:STDOUT: -// CHECK:STDOUT: fn[@J.%self.loc93_20.2: bool](@J.%b.loc93_32.2: bool) -> bool; +// CHECK:STDOUT: fn[%self: bool](%b: bool) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.6[@impl.7.%self.loc104_10.2: bool]() -> bool; +// CHECK:STDOUT: fn @F.6[%self: bool]() -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.7(@impl.8.%b.loc117_10.2: bool) -> bool; +// CHECK:STDOUT: fn @F.7(%b: bool) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.8[@impl.9.%self.loc130_10.2: bool](@impl.9.%b.loc130_22.2: bool); +// CHECK:STDOUT: fn @F.8[%self: bool](%b: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.9[@impl.10.%self.loc143_10.2: bool](@impl.10.%b.loc143_22.2: %FDifferentParamType) -> bool; +// CHECK:STDOUT: fn @F.9[%self: bool](%b: %FDifferentParamType) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.10[@impl.11.%self.loc156_10.2: %FDifferentImplicitParamType](@impl.11.%b.loc156_22.2: bool) -> bool; +// CHECK:STDOUT: fn @F.10[%self: %FDifferentImplicitParamType](%b: bool) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.11[@impl.12.%self.loc169_10.2: bool](@impl.12.%b.loc169_22.2: bool) -> %FDifferentReturnType; +// CHECK:STDOUT: fn @F.11[%self: bool](%b: bool) -> %FDifferentReturnType; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.12[@impl.13.%self.loc183_10.2: bool](@impl.13.%not_b.loc183_22.2: bool) -> bool; +// CHECK:STDOUT: fn @F.12[%self: bool](%not_b: bool) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: @@ -896,12 +928,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.3: type = tuple_type (@F.13.%.1 (%.11), @F.13.%.2 (%.12)) [symbolic = %.3 (constants.%.14)] // CHECK:STDOUT: %.4: type = array_type constants.%.15, @F.13.%Self (%Self.3) [symbolic = %.4 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@SelfNested.%x.loc188_8.2: @F.13.%.3 (%.14)) -> @F.13.%.4 (%.16); +// CHECK:STDOUT: fn(%x: @F.13.%.3 (%.14)) -> @F.13.%.4 (%.16); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.14(@impl.14.%x.loc200_10.2: %.21) -> %.22; +// CHECK:STDOUT: fn @F.14(%x: %.21) -> %.22; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.15(@impl.15.%x.loc212_10.2: %.27) -> %.22; +// CHECK:STDOUT: fn @F.15(%x: %.27) -> %.22; // 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 acee91911f2d..4279b697142c 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -59,12 +59,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,12 +75,12 @@ impl i32 as false {} // CHECK:STDOUT: %.loc21_13.1: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.6] // CHECK:STDOUT: %.loc21_13.2: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.8] // CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc21_13.2 [template = constants.%.8] -// CHECK:STDOUT: %.loc21_13.3: type = converted %.loc21_13.4, [template = ] -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %.loc21_13.3: type = converted @impl.%.loc21_13, [template = ] +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_6.2: type = converted %int.make_type_32, %.loc21_6.1 [template = i32] -// CHECK:STDOUT: %.loc21_13.4: bool = bool_literal false [template = constants.%.2] +// CHECK:STDOUT: %.loc21_13: bool = bool_literal false [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 8af9f3d04fe5..33a7736a3e5f 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -52,18 +52,18 @@ impl i32 as I {} // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32.loc13, %.loc13_6.1 [template = i32] -// CHECK:STDOUT: %I.ref.loc13: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_6.2: type = converted %int.make_type_32.loc21, %.loc21_6.1 [template = i32] -// CHECK:STDOUT: %I.ref.loc21: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: 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 7d166b73adcb..a74808b02209 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -49,12 +49,12 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %bool.make_type.loc16_6: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %bool.make_type.loc16_6 [template = bool] // CHECK:STDOUT: %.loc16_6.2: type = converted %bool.make_type.loc16_6, %.loc16_6.1 [template = bool] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %T.ref: %.2 = name_ref T, @I.%.loc11 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index 716f29137853..6889d5d322b8 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -61,13 +61,13 @@ class C { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -77,7 +77,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc16: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -86,7 +86,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.6 [template = constants.%.7] diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 807e989d5bd6..35480f0aa6aa 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -51,18 +51,20 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} // CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %T.loc15_14.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T 0, %T.loc15_14.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.2 [symbolic = constants.%T] -// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// 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: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -72,7 +74,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %T as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc15: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -85,7 +87,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(file.%T.loc15_14.2: type) { +// CHECK:STDOUT: generic fn @F.2(@impl.%T: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() { diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index d905b6b78403..8e00c1dbf450 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -67,22 +67,24 @@ fn G(c: C) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, %HasF.decl [template = constants.%.1] +// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %C.ref.loc23: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %c.loc23_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc23_6.1 +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -92,7 +94,7 @@ fn G(c: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -123,7 +125,7 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %G.ref.loc24: %.3 = name_ref G, @C.%G [template = constants.%.4] // CHECK:STDOUT: %.loc24: %F.type.1 = interface_witness_access @impl.%.loc19, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc24: init %.2 = call %.loc24() 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 748bc8cea4f8..a3a8e9de4f0b 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 @@ -67,18 +67,20 @@ fn F(c: C) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// 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.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %c.loc19_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @F.2.%c: %C = bind_name c, %c.loc19_6.1 +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -105,7 +107,7 @@ fn F(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%c: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc24: %.3 = name_ref F, @C.%F [template = constants.%.4] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref.loc28: %.3 = name_ref F, @C.%F [template = constants.%.4] diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index ca5ec67a874f..faadb91a7b3d 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -74,23 +74,23 @@ impl C as I { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// 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: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// 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: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: @F.2.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %I.ref.loc27: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -100,7 +100,7 @@ impl C as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} +// CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} {} // CHECK:STDOUT: %.loc27: = interface_witness (%F.decl) [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -109,8 +109,8 @@ impl C as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %I.ref.loc16: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 914a261bdab7..a25cc256410f 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -68,17 +68,17 @@ fn G(c: Impl.C) { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, %HasF.decl [template = constants.%.1] +// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc5: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -88,7 +88,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -173,10 +173,12 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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.6 [template = constants.%C] -// CHECK:STDOUT: %c.loc4_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc4_6.1 +// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -200,7 +202,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] +// CHECK:STDOUT: %Impl.ref.loc5: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.3] // CHECK:STDOUT: %F.ref: %.6 = name_ref F, imports.%import_ref.3 [template = constants.%.7] // CHECK:STDOUT: %.loc5: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 5d9b0656866e..2d09f80c13d8 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -70,50 +70,56 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl.loc11: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl.loc11: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// 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.ref: type = name_ref C, %C.decl.loc11 [template = constants.%C] -// CHECK:STDOUT: %c.loc23_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @F.3.%c: %C = bind_name c, %c.loc23_6.1 +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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: @F.3.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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.ref: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = @F.1.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc14_8.1: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_8.2: @F.1.%Self (%Self) = bind_name self, %self.loc14_8.1 +// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: %.1 = 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_28: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc14: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc14_28 +// CHECK:STDOUT: .F = %.loc14 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // 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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.loc19_10.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_10.2: %C = bind_name self, %self.loc19_10.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -123,7 +129,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: = complete_type_witness %.6 [template = constants.%.7] @@ -138,15 +144,15 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@I.%self.loc14_8.2: @F.1.%Self (%Self)]() -> i32; +// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)]() -> i32; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[@impl.%self.loc19_10.2: %C]() -> i32; +// CHECK:STDOUT: fn @F.2[%self: %C]() -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @F.3(%c: %C) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc14_28 [template = constants.%.4] +// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc14 [template = constants.%.4] // CHECK:STDOUT: %.loc24_11.1: %F.type.1 = interface_witness_access @impl.%.loc18, element0 [template = constants.%F.2] // CHECK:STDOUT: %.loc24_11.2: = bound_method %c.ref, %.loc24_11.1 // CHECK:STDOUT: %F.call: init i32 = call %.loc24_11.2(%c.ref) diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index aad01da1bf5e..5144bf0473fe 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -53,17 +53,17 @@ fn G(c: Impl.C) { // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, %HasF.decl [template = constants.%.1] +// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc5: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -73,7 +73,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -146,10 +146,12 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// 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.6 [template = constants.%C] -// CHECK:STDOUT: %c.loc4_6.1: %C = param c, runtime_param0 -// CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc4_6.1 +// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -173,7 +175,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] +// CHECK:STDOUT: %Impl.ref.loc5: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.3] // CHECK:STDOUT: %F.ref: %.6 = name_ref F, imports.%import_ref.3 [template = constants.%.7] // CHECK:STDOUT: %.loc5: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] diff --git a/toolchain/check/testdata/impl/no_prelude/basic.carbon b/toolchain/check/testdata/impl/no_prelude/basic.carbon index 774ef61a0661..9515e3369e08 100644 --- a/toolchain/check/testdata/impl/no_prelude/basic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/basic.carbon @@ -41,17 +41,17 @@ impl C as Simple { // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] +// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -61,7 +61,7 @@ impl C as Simple { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc17: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon index 64c5a62ea631..05503cf8486d 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon @@ -29,11 +29,11 @@ impl true as I {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc16_6.1: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: %.loc16_6.2: type = converted %.loc16_6.1, [template = ] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -46,9 +46,9 @@ impl true as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: as %.1 { -// CHECK:STDOUT: %.loc16: = interface_witness () [template = constants.%.4] +// CHECK:STDOUT: %.loc16_16: = interface_witness () [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc16 +// CHECK:STDOUT: witness = %.loc16_16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index e942e73534a5..e113501308f6 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -46,39 +46,42 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Add = %Add.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.1] {} +// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] // CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] { -// CHECK:STDOUT: %Self.ref.loc5_15: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc5_9.1: @Op.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc5_9.2: @Op.%Self (%Self) = bind_name self, %self.loc5_9.1 -// CHECK:STDOUT: %Self.ref.loc5_28: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_28.1: type = facet_type_access %Self.ref.loc5_28 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %.loc5_28.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %other.loc5_21.1: @Op.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other.loc5_21.2: @Op.%Self (%Self) = bind_name other, %other.loc5_21.1 -// CHECK:STDOUT: %Self.ref.loc5_37: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_37.1: type = facet_type_access %Self.ref.loc5_37 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = @Op.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @Op.%Self (%Self) = var +// CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc5_15: %.1 = 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: %.1 = 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: %.1 = 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: } -// CHECK:STDOUT: %.loc5_41: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc5: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Op = %.loc5_41 +// CHECK:STDOUT: .Op = %.loc5 // CHECK:STDOUT: witness = (%Op.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op(@Add.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@Add.%self.loc5_9.2: @Op.%Self (%Self)](@Add.%other.loc5_21.2: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { @@ -106,9 +109,9 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.4 = import_ref Main//a, inst+25, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+19, unloaded +// CHECK:STDOUT: %import_ref.3: %.4 = import_ref Main//a, inst+27, loaded [template = constants.%.5] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -117,23 +120,26 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc6_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %y.patt: %.1 = binding_pattern y +// 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.loc10_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @F.%x: %.1 = bind_name x, %x.loc10_6.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.loc10_13.1: %.1 = param y, runtime_param1 -// CHECK:STDOUT: @F.%y: %.1 = bind_name y, %y.loc10_13.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: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -146,23 +152,26 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.1 as %.2 { // 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: %other.patt: %.1 = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %self.loc7_9.1: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_9.2: %.1 = bind_name self, %self.loc7_9.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, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %other.loc7_21.1: %.1 = param other, runtime_param1 -// CHECK:STDOUT: %other.loc7_21.2: %.1 = bind_name other, %other.loc7_21.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, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %return.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6: = interface_witness (%Op.decl) [template = constants.%.3] +// CHECK:STDOUT: %.loc6_16: = interface_witness (%Op.decl) [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %.loc6 +// CHECK:STDOUT: witness = %.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.%self.loc7_9.2: %.1](@impl.%other.loc7_21.2: %.1) -> %.1 { +// CHECK:STDOUT: fn @Op.1[%self: %.1](%other: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc7_52: %.1 = tuple_literal () // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] @@ -181,7 +190,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %x.ref: %.1 = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: %Op.ref: %.4 = name_ref Op, imports.%import_ref.3 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_11.1: %Op.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %.loc11_11.1: %Op.type.2 = interface_witness_access @impl.%.loc6_16, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc11_11.2: = bound_method %x.ref, %.loc11_11.1 // CHECK:STDOUT: %y.ref: %.1 = name_ref y, %y // CHECK:STDOUT: %Op.call: init %.1 = call %.loc11_11.2(%x.ref, %y.ref) diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index d65de71d0ce1..8a6fd56c6084 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -118,39 +118,43 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Action.decl: %Action.type = interface_decl @Action [template = constants.%Action] { -// CHECK:STDOUT: %T.loc4_18.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T 0, %T.loc4_18.1 [symbolic = @Action.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %A.ref.loc12: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, %Action.decl [template = constants.%Action] -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc12: type = interface_type @Action, @Action(constants.%B) [template = constants.%.7] +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, file.%Action.decl [template = constants.%Action] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc12_17: type = interface_type @Action, @Action(constants.%B) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %A.ref.loc16: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %a.loc16_6.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: %A = bind_name a, %a.loc16_6.1 +// CHECK:STDOUT: %a.patt: %A = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Action(file.%T.loc4_18.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @Action(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T) [symbolic = %Op.type (constants.%Op.type.1)] +// CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T.1) [symbolic = %Op.type (constants.%Op.type.1)] // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.1) = struct_value () [symbolic = %Op (constants.%Op.1)] // CHECK:STDOUT: %.2: type = assoc_entity_type @Action.%.1 (%.2), @Action.%Op.type (%Op.type.1) [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: @Action.%.2 (%.3) = assoc_entity element0, %Op.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @Action.%.1 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %Op.decl: @Action.%Op.type (%Op.type.1) = fn_decl @Op.1 [symbolic = %Op (constants.%Op.1)] {} +// CHECK:STDOUT: %Op.decl: @Action.%Op.type (%Op.type.1) = fn_decl @Op.1 [symbolic = @Action.%Op (constants.%Op.1)] {} {} // CHECK:STDOUT: %.loc5: @Action.%.2 (%.3) = assoc_entity element0, %Op.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -161,12 +165,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %A as %.7 { -// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] {} -// CHECK:STDOUT: %.loc12: = interface_witness (%Op.decl) [template = constants.%.10] +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] {} {} +// CHECK:STDOUT: %.loc12_21: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %.loc12 +// CHECK:STDOUT: witness = %.loc12_21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -190,7 +194,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(file.%T.loc4_18.2: type, @Action.%Self.1: @Action.%.1 (%.2)) { +// CHECK:STDOUT: generic fn @Op.1(@Action.%T.loc4: type, @Action.%Self.1: @Action.%.1 (%.2)) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } @@ -208,23 +212,23 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %.loc16_23: type = interface_type @Action, @Action(constants.%B) [template = constants.%.7] // CHECK:STDOUT: %.loc16_26: %.8 = specific_constant @Action.%.loc5, @Action(constants.%B) [template = constants.%.9] // CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, %.loc16_26 [template = constants.%.9] -// CHECK:STDOUT: %.loc16_15: %Op.type.3 = interface_witness_access @impl.%.loc12, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %.loc16_15: %Op.type.3 = interface_witness_access @impl.%.loc12_21, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.call: init %.1 = call %.loc16_15() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Action(@Action.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Action(@Action.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%B) { -// CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.1 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.7 @@ -270,20 +274,20 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type = import_ref Main//action, inst+4, loaded [template = constants.%Action] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+24, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+29, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+32, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+54, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+25, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+30, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+10, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.11)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+48, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+12, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type = 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+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+31, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+11, unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+17, loaded [symbolic = @Action.%.3 (constants.%.11)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+49, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -298,9 +302,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.1 = import // 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: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.loc4_6.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @G.%a: %A = bind_name a, %a.loc4_6.1 +// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -416,21 +422,21 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type = import_ref Main//action, inst+4, loaded [template = constants.%Action] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+24, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+32, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+54, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+25, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+30, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+10, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+48, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+33, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+12, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type = 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+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+31, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+11, unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+17, loaded [symbolic = @Action.%.3 (constants.%.14)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+49, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+34, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -445,9 +451,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.1 = import // 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: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.loc8_6.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @G.%a: %A = bind_name a, %a.loc8_6.1 +// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -574,35 +582,37 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Factory.decl: %Factory.type = interface_decl @Factory [template = constants.%Factory] { -// CHECK:STDOUT: %T.loc4_19.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T 0, %T.loc4_19.1 [symbolic = @Factory.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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: impl_decl @impl { -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, %Factory.decl [template = constants.%Factory] -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc11: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.7] +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, file.%Factory.decl [template = constants.%Factory] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc11_18: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Factory(file.%T.loc4_19.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @Factory(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.1)] +// CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T.1) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: %.2: type = assoc_entity_type @Factory.%.1 (%.2), @Factory.%Make.type (%Make.type.1) [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: @Factory.%.2 (%.3) = assoc_entity element0, %Make.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @Factory.%.1 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %Make.decl: @Factory.%Make.type (%Make.type.1) = fn_decl @Make.1 [symbolic = %Make (constants.%Make.1)] { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_19.2 [symbolic = @Make.1.%T (constants.%T)] -// CHECK:STDOUT: %return.var: ref @Make.1.%T (%T) = var +// CHECK:STDOUT: %Make.decl: @Factory.%Make.type (%Make.type.1) = fn_decl @Make.1 [symbolic = @Factory.%Make (constants.%Make.1)] {} { +// CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %return: ref @Make.1.%T (%T) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc5: @Factory.%.2 (%.3) = assoc_entity element0, %Make.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: @@ -614,15 +624,15 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %A as %.7 { -// CHECK:STDOUT: %Make.decl: %Make.type.2 = fn_decl @Make.2 [template = constants.%Make.2] { +// CHECK:STDOUT: %Make.decl: %Make.type.2 = fn_decl @Make.2 [template = constants.%Make.2] {} { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %return.var: ref %B = var +// CHECK:STDOUT: %return: ref %B = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11: = interface_witness (%Make.decl) [template = constants.%.10] +// CHECK:STDOUT: %.loc11_22: = interface_witness (%Make.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: witness = %.loc11 +// CHECK:STDOUT: witness = %.loc11_22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -639,7 +649,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make.1(file.%T.loc4_19.2: type, @Factory.%Self.1: @Factory.%.1 (%.2)) { +// CHECK:STDOUT: generic fn @Make.1(@Factory.%T.loc4: type, @Factory.%Self.1: @Factory.%.1 (%.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.1.%T (%T); @@ -648,19 +658,19 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: fn @Make.2() -> %B; // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Factory(@Factory.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Factory(@Factory.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { -// CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.1 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.7 @@ -708,18 +718,18 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type = import_ref Main//factory, inst+4, loaded [template = constants.%Factory] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+27, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+32, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+28, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+33, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.11)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+50, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type = 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+29, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+34, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+11, unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+20, loaded [symbolic = @Factory.%.3 (constants.%.11)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+51, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+15, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -732,11 +742,13 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.1 = import // 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: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.loc4_10.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @MakeB.%a: %A = bind_name a, %a.loc4_10.1 -// CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] -// CHECK:STDOUT: @MakeB.%return: ref %B = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -784,7 +796,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] -// CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] +// CHECK:STDOUT: %B.ref.loc5: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %.loc5_20: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.5] // CHECK:STDOUT: %.loc5_23: %.8 = specific_constant imports.%import_ref.7, @Factory(constants.%B) [template = constants.%.9] // CHECK:STDOUT: %Make.ref: %.8 = name_ref Make, %.loc5_23 [template = constants.%.9] @@ -856,18 +868,18 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type = import_ref Main//factory, inst+4, loaded [template = constants.%Factory] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+27, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+28, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+33, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+50, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type = 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+29, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+34, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+11, unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+20, loaded [symbolic = @Factory.%.3 (constants.%.14)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+51, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+15, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -880,13 +892,15 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.loc6_10.1: %A = param a, runtime_param0 -// CHECK:STDOUT: @MakeC.%a: %A = bind_name a, %a.loc6_10.1 -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @MakeC.%return: ref %C = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -941,7 +955,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc10_20: type = interface_type @Factory, @Factory(constants.%C) [template = constants.%.11] // CHECK:STDOUT: %.loc10_23: %.12 = specific_constant imports.%import_ref.7, @Factory(constants.%C) [template = constants.%.13] // CHECK:STDOUT: %Make.ref: %.12 = name_ref Make, %.loc10_23 [template = constants.%.13] diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index 9796a16d2c52..d150f8f6b29a 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -91,11 +91,11 @@ impl () as D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc6_7.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%.1] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -129,12 +129,12 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc4_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %A.ref.loc4: type = name_ref A, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc6_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %A.ref.loc6: type = name_ref A, imports.%import_ref.1 [template = constants.%.2] @@ -148,10 +148,10 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.1 as %.2 { -// CHECK:STDOUT: %.loc6: = interface_witness () [template = constants.%.3] +// CHECK:STDOUT: %.loc6_14: = interface_witness () [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc6 +// CHECK:STDOUT: witness = %.loc6_14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_decl_in_api.carbon @@ -201,11 +201,11 @@ impl () as D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: type = interface_decl @B [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %B.decl: type = interface_decl @B [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc6_7.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%.1] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -260,11 +260,11 @@ impl () as D; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = interface_decl @C [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %C.decl: type = interface_decl @C [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc6_7.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%.1] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -297,7 +297,7 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc8_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%.2] @@ -332,11 +332,11 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %D.decl: type = interface_decl @D [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %D.decl: type = interface_decl @D [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc9_7.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%.1] +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon index 0ff39a234adf..99c75200dd1b 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon @@ -49,31 +49,31 @@ class A { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %DefaultConstructible.decl: type = interface_decl @DefaultConstructible [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %DefaultConstructible.decl: type = interface_decl @DefaultConstructible [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @DefaultConstructible { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %Make.decl: %Make.type.1 = fn_decl @Make.1 [template = constants.%Make.1] { -// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @Make.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_16.1: type = facet_type_access %Self.ref [symbolic = @Make.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_16.2: type = converted %Self.ref, %.loc12_16.1 [symbolic = @Make.1.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @Make.1.%Self (%Self) = var +// CHECK:STDOUT: %Make.decl: %Make.type.1 = fn_decl @Make.1 [template = constants.%Make.1] {} { +// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, @DefaultConstructible.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.loc12_16.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.loc12_16.2: type = converted %Self.ref, %.loc12_16.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %return: ref @Make.1.%Self (%Self) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_20: %.3 = assoc_entity element0, %Make.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %Make.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Make = %.loc12_20 +// CHECK:STDOUT: .Make = %.loc12 // CHECK:STDOUT: witness = (%Make.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %Make.decl: %Make.type.2 = fn_decl @Make.2 [template = constants.%Make.2] { +// CHECK:STDOUT: %Make.decl: %Make.type.2 = fn_decl @Make.2 [template = constants.%Make.2] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %return.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = interface_witness (%Make.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -90,7 +90,7 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %DefaultConstructible.ref: type = name_ref DefaultConstructible, file.%DefaultConstructible.decl [template = constants.%.1] // CHECK:STDOUT: } @@ -106,12 +106,12 @@ class A { // CHECK:STDOUT: fn() -> @Make.1.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make.2() -> @impl.%return.var: %C { +// CHECK:STDOUT: fn @Make.2() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc21_33.1: %.5 = struct_literal () -// CHECK:STDOUT: %.loc21_33.2: init %C = class_init (), @impl.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc21_33.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc21_34: init %C = converted %.loc21_33.1, %.loc21_33.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc21_34 to @impl.%return.var +// CHECK:STDOUT: return %.loc21_34 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%Self) { 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 75ef0e5251cc..451c6b8508c6 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon @@ -90,90 +90,98 @@ impl D as SelfNested { // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .SelfNested = %SelfNested.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %UseSelf.ref.loc19: type = name_ref UseSelf, %UseSelf.decl [template = constants.%.1] +// CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %D.ref.loc23: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %UseSelf.ref.loc23: type = name_ref UseSelf, %UseSelf.decl [template = constants.%.1] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} -// CHECK:STDOUT: impl_decl @impl.3 { -// CHECK:STDOUT: %C.ref.loc31: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %SelfNested.ref.loc31: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.10] +// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} {} +// CHECK:STDOUT: impl_decl @impl.3 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.4 { -// CHECK:STDOUT: %D.ref.loc35: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %SelfNested.ref.loc35: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.10] +// CHECK:STDOUT: impl_decl @impl.4 {} { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @UseSelf { // CHECK:STDOUT: %Self: %.1 = 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.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %self.loc12_8.1: @F.1.%Self (%Self.1) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: @F.1.%Self (%Self.1) = bind_name self, %self.loc12_8.1 -// CHECK:STDOUT: %Self.ref.loc12_23: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_23.1: type = facet_type_access %Self.ref.loc12_23 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_23.2: type = converted %Self.ref.loc12_23, %.loc12_23.1 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %x.loc12_20.1: @F.1.%Self (%Self.1) = param x, runtime_param1 -// CHECK:STDOUT: %x.loc12_20.2: @F.1.%Self (%Self.1) = bind_name x, %x.loc12_20.1 -// CHECK:STDOUT: %Self.ref.loc12_32: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_32.1: type = facet_type_access %Self.ref.loc12_32 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %.loc12_32.2: type = converted %Self.ref.loc12_32, %.loc12_32.1 [symbolic = @F.1.%Self (constants.%Self.1)] -// CHECK:STDOUT: %return.var: ref @F.1.%Self (%Self.1) = var +// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self.1) = binding_pattern self +// CHECK:STDOUT: %x.patt: @F.1.%Self (%Self.1) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = 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: %.1 = 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: %.1 = 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: } -// CHECK:STDOUT: %.loc12_36: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc12_36 +// CHECK:STDOUT: .F = %.loc12 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @SelfNested { // CHECK:STDOUT: %Self: %.10 = 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: %Self.ref.loc28_12: %.10 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_16.1: type = facet_type_access %Self.ref.loc28_12 [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_16.2: type = converted %Self.ref.loc28_12, %.loc28_16.1 [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = @F.4.%.1 (constants.%.11)] -// CHECK:STDOUT: %Self.ref.loc28_24: %.10 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_24.1: type = facet_type_access %Self.ref.loc28_24 [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_24.2: type = converted %Self.ref.loc28_24, %.loc28_24.1 [symbolic = @F.4.%Self (constants.%Self.2)] +// CHECK:STDOUT: %x.patt: @F.4.%.3 (%.14) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc28_12: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_16.1: type = facet_type_access %Self.ref.loc28_12 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_16.2: type = converted %Self.ref.loc28_12, %.loc28_16.1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self.ref.loc28_24: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_24.1: type = facet_type_access %Self.ref.loc28_24 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_24.2: type = converted %Self.ref.loc28_24, %.loc28_24.1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_35.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc28_35.2: type = converted %.loc28_35.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = @F.4.%.2 (constants.%.12)] +// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: %.loc28_37.1: %.13 = tuple_literal (%.loc28_16.3, %.loc28_36) -// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.14 [symbolic = @F.4.%.3 (constants.%.14)] -// CHECK:STDOUT: %x.loc28_8.1: @F.4.%.3 (%.14) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc28_8.2: @F.4.%.3 (%.14) = bind_name x, %x.loc28_8.1 +// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.14 [symbolic = %.3 (constants.%.14)] +// CHECK:STDOUT: %x.param: @F.4.%.3 (%.14) = param x, runtime_param0 +// CHECK:STDOUT: %x: @F.4.%.3 (%.14) = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc28_39: %.15 = assoc_entity element0, %F.decl [template = constants.%.16] +// CHECK:STDOUT: %.loc28: %.15 = assoc_entity element0, %F.decl [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc28_39 +// CHECK:STDOUT: .F = %.loc28 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.1 { // 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: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc20_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc20_8.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_8.2: %C = bind_name self, %self.loc20_8.1 +// 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.loc20_17.1: %C = param x, runtime_param1 -// CHECK:STDOUT: %x.loc20_17.2: %C = bind_name x, %x.loc20_17.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -184,14 +192,17 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %D as %.1 { // 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: %x.patt: %D = binding_pattern x +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc24_14: type = name_ref Self, constants.%D [template = constants.%D] -// CHECK:STDOUT: %self.loc24_8.1: %D = param self, runtime_param0 -// CHECK:STDOUT: %self.loc24_8.2: %D = bind_name self, %self.loc24_8.1 +// 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, constants.%D [template = constants.%D] -// CHECK:STDOUT: %x.loc24_20.1: %D = param x, runtime_param1 -// CHECK:STDOUT: %x.loc24_20.2: %D = bind_name x, %x.loc24_20.1 +// 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, constants.%D [template = constants.%D] -// CHECK:STDOUT: %return.var: ref %D = var +// CHECK:STDOUT: %return: ref %D = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc23: = interface_witness (%F.decl) [template = constants.%.9] // CHECK:STDOUT: @@ -202,6 +213,8 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %C as %.10 { // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.5] { +// CHECK:STDOUT: %x.patt: %.19 = binding_pattern x +// 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.%.17] // CHECK:STDOUT: %C.ref.loc32_21: type = name_ref C, file.%C.decl [template = constants.%C] @@ -210,8 +223,8 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.2} [template = constants.%.18] // CHECK:STDOUT: %.loc32_31.1: %.13 = tuple_literal (%.loc32_13, %.loc32_30) // CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.19 [template = constants.%.19] -// CHECK:STDOUT: %x.loc32_8.1: %.19 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc32_8.2: %.19 = bind_name x, %x.loc32_8.1 +// CHECK:STDOUT: %x.param: %.19 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.19 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc31: = interface_witness (%F.decl) [template = constants.%.20] // CHECK:STDOUT: @@ -222,6 +235,8 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %D as %.10 { // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.6] { +// CHECK:STDOUT: %x.patt: %.23 = binding_pattern x +// CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, constants.%D [template = constants.%D] // CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.21] // CHECK:STDOUT: %Self.ref.loc36_24: type = name_ref Self, constants.%D [template = constants.%D] @@ -230,8 +245,8 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.2} [template = constants.%.22] // CHECK:STDOUT: %.loc36_37.1: %.13 = tuple_literal (%.loc36_16, %.loc36_36) // CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.23 [template = constants.%.23] -// CHECK:STDOUT: %x.loc36_8.1: %.23 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc36_8.2: %.23 = bind_name x, %x.loc36_8.1 +// CHECK:STDOUT: %x.param: %.23 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.23 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc35: = interface_witness (%F.decl) [template = constants.%.24] // CHECK:STDOUT: @@ -257,23 +272,23 @@ impl D as SelfNested { // CHECK:STDOUT: generic fn @F.1(@UseSelf.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@UseSelf.%self.loc12_8.2: @F.1.%Self (%Self.1)](@UseSelf.%x.loc12_20.2: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); +// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self.1)](%x: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[@impl.1.%self.loc20_8.2: %C](@impl.1.%x.loc20_17.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @F.2[%self: %C](%x: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc20_38.1: %.5 = struct_literal () -// CHECK:STDOUT: %.loc20_38.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct.1] +// CHECK:STDOUT: %.loc20_38.2: init %C = class_init (), %return [template = constants.%struct.1] // CHECK:STDOUT: %.loc20_39: init %C = converted %.loc20_38.1, %.loc20_38.2 [template = constants.%struct.1] -// CHECK:STDOUT: return %.loc20_39 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc20_39 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[@impl.2.%self.loc24_8.2: %D](@impl.2.%x.loc24_20.2: %D) -> @impl.2.%return.var: %D { +// CHECK:STDOUT: fn @F.3[%self: %D](%x: %D) -> %return: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc24_47.1: %.5 = struct_literal () -// CHECK:STDOUT: %.loc24_47.2: init %D = class_init (), @impl.2.%return.var [template = constants.%struct.2] +// CHECK:STDOUT: %.loc24_47.2: init %D = class_init (), %return [template = constants.%struct.2] // CHECK:STDOUT: %.loc24_48: init %D = converted %.loc24_47.1, %.loc24_47.2 [template = constants.%struct.2] -// CHECK:STDOUT: return %.loc24_48 to @impl.2.%return.var +// CHECK:STDOUT: return %.loc24_48 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.4(@SelfNested.%Self: %.10) { @@ -282,12 +297,12 @@ impl D as SelfNested { // CHECK:STDOUT: %.2: type = struct_type {.x: @F.4.%Self (%Self.2), .y: %.2} [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: %.3: type = tuple_type (@F.4.%.1 (%.11), @F.4.%.2 (%.12)) [symbolic = %.3 (constants.%.14)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@SelfNested.%x.loc28_8.2: @F.4.%.3 (%.14)); +// CHECK:STDOUT: fn(%x: @F.4.%.3 (%.14)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc32_8.2: %.19); +// CHECK:STDOUT: fn @F.5(%x: %.19); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc36_8.2: %.23); +// CHECK:STDOUT: fn @F.6(%x: %.23); // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index ce20d9f72a26..0098cc8c86fc 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -54,19 +54,19 @@ impl i32 as I {} // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32.loc13, %.loc13_6.1 [template = i32] -// CHECK:STDOUT: %I.ref.loc13: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_32.loc19, %.loc19_6.1 [template = i32] -// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -79,18 +79,18 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { -// CHECK:STDOUT: %.loc19: = interface_witness () [template = constants.%.5] +// CHECK:STDOUT: %.loc19_15: = interface_witness () [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc19 +// CHECK:STDOUT: witness = %.loc19_15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32, %.loc16_8.1 [template = i32] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] +// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] +// CHECK:STDOUT: %I.ref.loc16: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 2ed51bc49110..d9afcbfa8582 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -75,31 +75,35 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: .ValueBinding = %ValueBinding.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: 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 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11, %.loc11_12.1 [template = i32] +// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] // CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// 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.loc13_6.1: %.3 = param b, runtime_param0 -// CHECK:STDOUT: @G.%b: %.3 = bind_name b, %b.loc13_6.1 +// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %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: } { // 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.loc21_17.1: %.3 = param b, runtime_param0 -// CHECK:STDOUT: @ValueBinding.%b: %.3 = bind_name b, %b.loc21_17.1 +// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -153,10 +157,10 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @ValueBinding(%b: %.3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// 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] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32, %.loc22_11.1 [template = i32] +// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] +// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32.loc22, %.loc22_11.1 [template = i32] // CHECK:STDOUT: %.loc22_17: type = array_type %.loc22_16, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var 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 b8d3268543e8..280f942d1dba 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -63,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index cf331cd68210..19bdeb0b714d 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -76,22 +76,24 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: 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 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11, %.loc11_12.1 [template = i32] +// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] // CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// 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.loc13_6.1: %.3 = param b, runtime_param0 -// CHECK:STDOUT: @G.%b: %.3 = bind_name b, %b.loc13_6.1 +// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index abd686ca2835..6ac67f15af84 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -81,7 +81,7 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] // CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32.loc23, %.loc23_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 521fa2043bdf..873b9ffe7cd5 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -47,7 +47,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 4f5f77d6ba24..49b7d87066fd 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+72, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.4: %.11 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded +// CHECK:STDOUT: %import_ref.4: %.11 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.12] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index 2c4c3a4fa284..b08bf01991a1 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -44,7 +44,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index 7acb20f699ad..a349a91782ef 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -48,7 +48,7 @@ interface I { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { 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 356bc32bf4b7..fdc180c60355 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -57,12 +57,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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 { @@ -71,7 +71,7 @@ interface I { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 04a71bd3e713..05d30b5faf7a 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -58,7 +58,7 @@ interface I { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { 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 b6179bb88e93..96bf4b2b892e 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 @@ -60,35 +60,38 @@ interface Interface { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc16: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc21_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a.loc21_16.2: i32 = bind_name a, %a.loc21_16.1 +// 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.loc21_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b.loc21_24.2: i32 = bind_name b, %b.loc21_24.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21_39: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] +// CHECK:STDOUT: %.loc21: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %.loc16 -// CHECK:STDOUT: .G = %.loc21_39 +// CHECK:STDOUT: .G = %.loc21 // CHECK:STDOUT: witness = (%F.decl, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -105,7 +108,7 @@ interface Interface { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %.1) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Interface.%a.loc21_16.2: i32, @Interface.%b.loc21_24.2: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a: i32, %b: 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 eb4720d99d28..8961650d221a 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 @@ -106,52 +106,58 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// CHECK:STDOUT: %.decl.loc23: %.type.1 = fn_decl @.1 [template = constants.%.7] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} +// CHECK:STDOUT: %.decl.loc23: %.type.1 = fn_decl @.1 [template = constants.%.7] {} {} // CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.8] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc31_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @.2.%a: i32 = bind_name a, %a.loc31_16.1 +// 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.loc31_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: @.2.%b: i32 = bind_name b, %b.loc31_24.1 +// 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: @.2.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc7: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc13_16.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a.loc13_16.2: i32 = bind_name a, %a.loc13_16.1 +// 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.loc13_24.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b.loc13_24.2: i32 = bind_name b, %b.loc13_24.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_38: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] +// CHECK:STDOUT: %.loc13: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %.loc7 -// CHECK:STDOUT: .G = %.loc13_38 +// CHECK:STDOUT: .G = %.loc13 // CHECK:STDOUT: witness = (%F.decl, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,7 +170,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %.1) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Interface.%a.loc13_16.2: i32, @Interface.%b.loc13_24.2: i32) -> i32; +// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(@Interface.%Self: %.1) { @@ -224,25 +230,29 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} // 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: %u.patt: %U = binding_pattern u +// CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = constants.%C.2] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc20 [symbolic = constants.%C.2] -// CHECK:STDOUT: %self.loc20_18.1: %C.2 = param self, runtime_param0 -// CHECK:STDOUT: @F.%self: %C.2 = bind_name self, %self.loc20_18.1 -// CHECK:STDOUT: %U.loc20_30.1: type = param U, runtime_param -// CHECK:STDOUT: @F.%U.loc20: type = bind_symbolic_name U 1, %U.loc20_30.1 [symbolic = constants.%U] -// CHECK:STDOUT: %U.ref.loc20_43: type = name_ref U, @F.%U.loc20 [symbolic = constants.%U] -// CHECK:STDOUT: %u.loc20_40.1: %U = param u, runtime_param1 -// CHECK:STDOUT: @F.%u: %U = bind_name u, %u.loc20_40.1 -// CHECK:STDOUT: %U.ref.loc20_49: type = name_ref U, @F.%U.loc20 [symbolic = constants.%U] -// CHECK:STDOUT: @F.%return: ref %U = var +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C.1] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C.1] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -257,18 +267,22 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F: @C.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %.loc14: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = @F.%C (constants.%C.2)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc14 [symbolic = @F.%C (constants.%C.2)] -// CHECK:STDOUT: %self.loc14_10.1: @F.%C (%C.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_10.2: @F.%C (%C.2) = bind_name self, %self.loc14_10.1 -// CHECK:STDOUT: %U.loc14_22.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc14_22.2: type = bind_symbolic_name U 1, %U.loc14_22.1 [symbolic = @F.%U.1 (constants.%U)] -// CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14_22.2 [symbolic = @F.%U.1 (constants.%U)] -// CHECK:STDOUT: %u.loc14_32.1: @F.%U.1 (%U) = param u, runtime_param1 -// CHECK:STDOUT: %u.loc14_32.2: @F.%U.1 (%U) = bind_name u, %u.loc14_32.1 -// CHECK:STDOUT: %U.ref.loc14_41: type = name_ref U, %U.loc14_22.2 [symbolic = @F.%U.1 (constants.%U)] -// CHECK:STDOUT: %return.var: ref @F.%U.1 (%U) = var +// 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: %u.patt: %U = binding_pattern u +// 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: type = bind_symbolic_name U 1, %U.param.loc14 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %u.param.loc14: @F.%U.1 (%U) = param u, runtime_param1 +// CHECK:STDOUT: %u.loc14: @F.%U.1 (%U) = bind_name u, %u.param.loc14 +// CHECK:STDOUT: %U.ref.loc14_41: type = name_ref U, %U.loc14 [symbolic = %U.1 (constants.%U)] +// CHECK:STDOUT: %return.var.loc14: ref @F.%U.1 (%U) = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -278,16 +292,16 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@Interface.%Self: %.1, @C.%U.loc14_22.2: type) { +// CHECK:STDOUT: generic fn @F(@Interface.%Self: %.1, %U.loc14: type) { // CHECK:STDOUT: %Self: %.1 = 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.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: %C.2](%U.loc20: type, %u: %U) -> %U { +// CHECK:STDOUT: fn[%self.loc20: %C.2](%U.loc20: type, %u.loc20: %U) -> %U { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %u.ref: @F.%U.1 (%U) = name_ref u, %u +// CHECK:STDOUT: %u.ref: @F.%U.1 (%U) = name_ref u, %u.loc20 // CHECK:STDOUT: return %u.ref // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/as_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type.carbon index 7e3b42ad3222..e2a01a7ea580 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type.carbon @@ -27,11 +27,13 @@ fn F(e: Empty) {} // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} +// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] -// CHECK:STDOUT: %e.loc13_6.1: %.1 = param e, runtime_param0 -// CHECK:STDOUT: @F.%e: %.1 = bind_name e, %e.loc13_6.1 +// CHECK:STDOUT: %e.patt: %.1 = binding_pattern e +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%.1] +// CHECK:STDOUT: %e.param: %.1 = param e, runtime_param0 +// CHECK:STDOUT: %e: %.1 = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: } // 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 e7615eaef576..f18e45b833e6 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 @@ -30,11 +30,13 @@ fn F(T:! Empty) { // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} +// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] -// CHECK:STDOUT: %T.loc13_6.1: %.1 = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc13: %.1 = bind_symbolic_name T 0, %T.loc13_6.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%.1] +// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param +// CHECK:STDOUT: %T.loc13: %.1 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/basic.carbon b/toolchain/check/testdata/interface/no_prelude/basic.carbon index dd46d908f22d..f12aa1fd142e 100644 --- a/toolchain/check/testdata/interface/no_prelude/basic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/basic.carbon @@ -36,9 +36,9 @@ interface ForwardDeclared { // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc14 // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} -// CHECK:STDOUT: %ForwardDeclared.decl.loc14: type = interface_decl @ForwardDeclared [template = constants.%.2] {} -// CHECK:STDOUT: %ForwardDeclared.decl.loc16: type = interface_decl @ForwardDeclared [template = constants.%.2] {} +// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {} +// CHECK:STDOUT: %ForwardDeclared.decl.loc14: type = interface_decl @ForwardDeclared [template = constants.%.2] {} {} +// CHECK:STDOUT: %ForwardDeclared.decl.loc16: type = interface_decl @ForwardDeclared [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { @@ -51,7 +51,7 @@ interface ForwardDeclared { // CHECK:STDOUT: // CHECK:STDOUT: interface @ForwardDeclared { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc17: %.4 = assoc_entity element0, %F.decl [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon index 66636658efe5..81073712b3c9 100644 --- a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon @@ -47,12 +47,12 @@ class C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc14: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -62,7 +62,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc21: = interface_witness (%F.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -71,10 +71,10 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc24: = complete_type_witness %.6 [template = constants.%.7] // 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 c0838fd2b7e1..dd1167678824 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -49,7 +49,7 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -108,9 +108,11 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { +// CHECK:STDOUT: %i.patt: %.1 = binding_pattern i +// CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%.1] -// CHECK:STDOUT: %i.loc6_13.1: %.1 = param i, runtime_param0 -// CHECK:STDOUT: @UseEmpty.%i: %.1 = bind_name i, %i.loc6_13.1 +// CHECK:STDOUT: %i.param: %.1 = param i, runtime_param0 +// CHECK:STDOUT: %i: %.1 = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon index c2fbf5b60c76..8c6d538b0a83 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon @@ -55,9 +55,9 @@ interface Outer { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: .Outer = %Outer.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} -// CHECK:STDOUT: %Outer.decl: type = interface_decl @Outer [template = constants.%.3] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} +// CHECK:STDOUT: %Outer.decl: type = interface_decl @Outer [template = constants.%.3] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { @@ -71,8 +71,8 @@ interface Outer { // CHECK:STDOUT: // CHECK:STDOUT: interface @Outer { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] -// CHECK:STDOUT: %Inner.decl: type = interface_decl @Inner [template = constants.%.4] {} -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [symbolic = constants.%F.2] {} +// CHECK:STDOUT: %Inner.decl: type = interface_decl @Inner [template = constants.%.4] {} {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [symbolic = constants.%F.2] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -90,7 +90,7 @@ interface Outer { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @Inner.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.3 (constants.%Self.3)] -// CHECK:STDOUT: %.decl: @Inner.%.type (%.type) = fn_decl @.1 [symbolic = %.2 (constants.%.6)] {} +// CHECK:STDOUT: %.decl: @Inner.%.type (%.type) = fn_decl @.1 [symbolic = @Inner.%.2 (constants.%.6)] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index e00029fc47f9..0e81bbdbfec9 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -39,7 +39,7 @@ alias UseOther = I.other; // CHECK:STDOUT: .UseA = %UseA // CHECK:STDOUT: .UseOther = %UseOther // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: %I.ref.loc23: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] // CHECK:STDOUT: %UseA: = bind_alias UseA, [template = ] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index decde9cd4ed4..90ab838a4956 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -38,7 +38,7 @@ interface I {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I; @@ -60,7 +60,7 @@ interface I {} // CHECK:STDOUT: .I = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index b3fabc8642cc..09669b31f515 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -87,8 +87,8 @@ interface Class { } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { @@ -101,7 +101,7 @@ interface Class { } // CHECK:STDOUT: // CHECK:STDOUT: interface @.1 { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc14: %.4 = assoc_entity element0, %F.decl [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -135,8 +135,8 @@ interface Class { } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { @@ -150,24 +150,26 @@ interface Class { } // CHECK:STDOUT: interface @.1 { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Self.ref: %.2 = name_ref Self, %Self [symbolic = @F.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = @F.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = @F.%Self (constants.%Self.2)] -// CHECK:STDOUT: %self.loc14_8.1: @F.%Self (%Self.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14_8.2: @F.%Self (%Self.2) = bind_name self, %self.loc14_8.1 +// CHECK:STDOUT: %self.patt: @F.%Self (%Self.2) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: %.2 = 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: } -// CHECK:STDOUT: %.loc14_21: %.4 = assoc_entity element0, %F.decl [template = constants.%.5] +// CHECK:STDOUT: %.loc14: %.4 = assoc_entity element0, %F.decl [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc14_21 +// CHECK:STDOUT: .F = %.loc14 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(@.1.%Self: %.2) { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@.1.%self.loc14_8.2: @F.%Self (%Self.2)](); +// CHECK:STDOUT: fn[%self: @F.%Self (%Self.2)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self.2) { @@ -187,8 +189,8 @@ interface Class { } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Function = %Function.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [template = constants.%Function] {} -// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [template = constants.%Function] {} {} +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @.1; @@ -207,8 +209,8 @@ interface Class { } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.1] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @.1 { 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 72ae61fee771..3be02b502eae 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -66,35 +66,43 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: .Generic = %Generic.decl // CHECK:STDOUT: .DifferentParams = %DifferentParams.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %NotGeneric.decl: type = interface_decl @NotGeneric [template = constants.%.1] {} +// CHECK:STDOUT: %NotGeneric.decl: type = interface_decl @NotGeneric [template = constants.%.1] {} {} // CHECK:STDOUT: %.decl.loc19: %.type.1 = interface_decl @.1 [template = constants.%.3] { -// CHECK:STDOUT: %T.loc19_22.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_22.2: type = bind_symbolic_name T 0, %T.loc19_22.1 [symbolic = @.1.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc19: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl: %Generic.type = interface_decl @Generic [template = constants.%Generic] { -// CHECK:STDOUT: %T.loc21_19.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc21_19.2: type = bind_symbolic_name T 0, %T.loc21_19.1 [symbolic = @Generic.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc21: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc29: type = interface_decl @.2 [template = constants.%.5] {} +// CHECK:STDOUT: %.decl.loc29: type = interface_decl @.2 [template = constants.%.5] {} {} // CHECK:STDOUT: %DifferentParams.decl: %DifferentParams.type = interface_decl @DifferentParams [template = constants.%DifferentParams] { -// CHECK:STDOUT: %T.loc31_27.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc31_27.2: type = bind_symbolic_name T 0, %T.loc31_27.1 [symbolic = @DifferentParams.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc31: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc38: %.type.2 = interface_decl @.3 [template = constants.%.6] { +// CHECK:STDOUT: %T.patt: %.2 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { // CHECK:STDOUT: %.loc38_32.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc38_32.2: type = converted %.loc38_32.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %T.loc38_27.1: %.2 = param T, runtime_param -// CHECK:STDOUT: %T.loc38_27.2: %.2 = bind_symbolic_name T 0, %T.loc38_27.1 [symbolic = @.3.%T (constants.%T.2)] +// CHECK:STDOUT: %T.param: %.2 = param T, runtime_param +// CHECK:STDOUT: %T.loc38: %.2 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @NotGeneric; // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%T.loc19_22.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @.1(%T.loc19: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%T.1) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -106,8 +114,8 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Generic(file.%T.loc21_19.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @Generic(%T.loc21: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -120,17 +128,17 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @DifferentParams(file.%T.loc31_27.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @DifferentParams(%T.loc31: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.3(file.%T.loc38_27.2: %.2) { -// CHECK:STDOUT: %T: %.2 = bind_symbolic_name T 0 [symbolic = %T (constants.%T.2)] +// CHECK:STDOUT: generic interface @.3(%T.loc38: %.2) { +// CHECK:STDOUT: %T.1: %.2 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.3, @.3(%T) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %.1: type = interface_type @.3, @.3(%T.1) [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.3)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -143,26 +151,26 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%T) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: specific @.1(@.1.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DifferentParams(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.3(constants.%T.2) { -// CHECK:STDOUT: %T => constants.%T.2 +// CHECK:STDOUT: %T.1 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.3(@.3.%T) { -// CHECK:STDOUT: %T => constants.%T.2 +// CHECK:STDOUT: specific @.3(@.3.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index 1258c05f635c..f525025a3d43 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -74,23 +74,23 @@ interface BeingDefined { // CHECK:STDOUT: .Test = %Test.decl // CHECK:STDOUT: .BeingDefined = %BeingDefined.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Undefined.decl: type = interface_decl @Undefined [template = constants.%.1] {} -// CHECK:STDOUT: %.decl: %.type.1 = fn_decl @.1 [template = constants.%.3] {} -// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} -// CHECK:STDOUT: %BeingDefined.decl: type = interface_decl @BeingDefined [template = constants.%.4] {} +// CHECK:STDOUT: %Undefined.decl: type = interface_decl @Undefined [template = constants.%.1] {} {} +// CHECK:STDOUT: %.decl: %.type.1 = fn_decl @.1 [template = constants.%.3] {} {} +// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} +// CHECK:STDOUT: %BeingDefined.decl: type = interface_decl @BeingDefined [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Undefined; // CHECK:STDOUT: // CHECK:STDOUT: interface @BeingDefined { // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} { // CHECK:STDOUT: %BeingDefined.ref: type = name_ref BeingDefined, file.%BeingDefined.decl [template = constants.%.4] // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] -// CHECK:STDOUT: %return.var: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc45: %.5 = assoc_entity element0, %H.decl [template = constants.%.6] -// CHECK:STDOUT: %.decl: %.type.2 = fn_decl @.2 [template = constants.%.7] {} +// CHECK:STDOUT: %.decl: %.type.2 = fn_decl @.2 [template = constants.%.7] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon index c634153de07d..8917dfe9f56d 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon @@ -48,13 +48,13 @@ fn F() { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = 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: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %.loc14: %.5 = assoc_entity element1, %T [template = constants.%.6] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon index 5d7566b4dcde..2713cf3ffdcb 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon @@ -51,10 +51,10 @@ protected interface Protected; // CHECK:STDOUT: .Virtual = %Virtual.decl // CHECK:STDOUT: .Protected = %Protected.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Abstract.decl: type = interface_decl @Abstract [template = constants.%.1] {} -// CHECK:STDOUT: %Default.decl: type = interface_decl @Default [template = constants.%.2] {} -// CHECK:STDOUT: %Virtual.decl: type = interface_decl @Virtual [template = constants.%.3] {} -// CHECK:STDOUT: %Protected.decl: type = interface_decl @Protected [template = constants.%.4] {} +// CHECK:STDOUT: %Abstract.decl: type = interface_decl @Abstract [template = constants.%.1] {} {} +// CHECK:STDOUT: %Default.decl: type = interface_decl @Default [template = constants.%.2] {} {} +// CHECK:STDOUT: %Virtual.decl: type = interface_decl @Virtual [template = constants.%.3] {} {} +// CHECK:STDOUT: %Protected.decl: type = interface_decl @Protected [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Abstract { diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon index 862c543c7d66..3e7f9e7cf9b6 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon @@ -37,14 +37,14 @@ interface Interface { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self 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 164b05acac0e..140fa2158e97 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 @@ -48,27 +48,32 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: .CallStatic = %CallStatic.decl // CHECK:STDOUT: .CallFacet = %CallFacet.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} +// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {} // CHECK:STDOUT: %CallStatic.decl: %CallStatic.type = fn_decl @CallStatic [template = constants.%CallStatic] { -// CHECK:STDOUT: %Interface.ref.loc13: type = name_ref Interface, %Interface.decl [template = constants.%.1] -// CHECK:STDOUT: %T.loc13_15.1: %.1 = param T, runtime_param -// CHECK:STDOUT: @CallStatic.%T.loc13: %.1 = bind_symbolic_name T 0, %T.loc13_15.1 [symbolic = @CallStatic.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%.1] +// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param +// CHECK:STDOUT: %T.loc13: %.1 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallFacet.decl: %CallFacet.type = fn_decl @CallFacet [template = constants.%CallFacet] { -// CHECK:STDOUT: %Interface.ref.loc21: type = name_ref Interface, %Interface.decl [template = constants.%.1] -// CHECK:STDOUT: %T.loc21_14.1: %.1 = param T, runtime_param -// CHECK:STDOUT: @CallFacet.%T.loc21: %.1 = bind_symbolic_name T 0, %T.loc21_14.1 [symbolic = @CallFacet.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref: %.1 = name_ref T, @CallFacet.%T.loc21 [symbolic = @CallFacet.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc21_32.1: type = facet_type_access %T.ref [symbolic = @CallFacet.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc21_32.2: type = converted %T.ref, %.loc21_32.1 [symbolic = @CallFacet.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc21_29.1: @CallFacet.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @CallFacet.%x: @CallFacet.%T.1 (%T) = bind_name x, %x.loc21_29.1 +// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %x.patt: @CallFacet.%T.1 (%T) = binding_pattern x +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%.1] +// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param +// CHECK:STDOUT: %T.loc21: %.1 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: %.1 = name_ref T, %T.loc21 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc21_32.1: type = facet_type_access %T.ref [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc21_32.2: type = converted %T.ref, %.loc21_32.1 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @CallFacet.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: %x: @CallFacet.%T.1 (%T) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc11: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: 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 2ccd9a1c9f45..99308b9f9be9 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 @@ -43,72 +43,78 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: %I.type = interface_decl @I [template = constants.%I] { -// CHECK:STDOUT: %T.loc11_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @I.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [symbolic = constants.%.5] { -// CHECK:STDOUT: %T.loc22_6.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc22_6.2: type = bind_symbolic_name T 0, %T.loc22_6.1 [symbolic = @.1.%T (constants.%T)] -// CHECK:STDOUT: %.loc22_24.1: @.1.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc22_24: @.1.%.1 (%.2) = name_ref Self, %.loc22_24.1 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc22_24.2: type = facet_type_access %Self.ref.loc22_24 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc22_24.3: type = converted %Self.ref.loc22_24, %.loc22_24.2 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc22_18.1: @.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: @.1.%self: @.1.%Self (%Self) = bind_name self, %self.loc22_18.1 -// CHECK:STDOUT: %.loc22_35.1: @.1.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc22_35: @.1.%.1 (%.2) = name_ref Self, %.loc22_35.1 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc22_35.2: type = facet_type_access %Self.ref.loc22_35 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc22_35.3: type = converted %Self.ref.loc22_35, %.loc22_35.2 [symbolic = @.1.%Self (constants.%Self)] -// CHECK:STDOUT: @.1.%return: ref @.1.%Self (%Self) = var +// CHECK:STDOUT: %self.patt: @.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc22: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc22_24.1: @.1.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc22_24: @.1.%.1 (%.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.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc22_35: @.1.%.1 (%.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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @I(file.%T.loc11_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @I(%T.loc11: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @I, @I(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @I, @I(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %F.type: type = fn_type @F, @I(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @I(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @I.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: %.2: type = assoc_entity_type @I.%.1 (%.2), @I.%F.type (%F.type) [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: @I.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @I.%.1 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %F.decl: @I.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { -// CHECK:STDOUT: %.loc13_14.1: @F.%.1 (%.2) = specific_constant %Self.1, @I(constants.%T) [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc13_14: @F.%.1 (%.2) = name_ref Self, %.loc13_14.1 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_14.2: type = facet_type_access %Self.ref.loc13_14 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_14.3: type = converted %Self.ref.loc13_14, %.loc13_14.2 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc13_8.1: @F.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8.2: @F.%Self (%Self) = bind_name self, %self.loc13_8.1 -// CHECK:STDOUT: %.loc13_25.1: @F.%.1 (%.2) = specific_constant %Self.1, @I(constants.%T) [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc13_25: @F.%.1 (%.2) = name_ref Self, %.loc13_25.1 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_25.2: type = facet_type_access %Self.ref.loc13_25 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc13_25.3: type = converted %Self.ref.loc13_25, %.loc13_25.2 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @F.%Self (%Self) = var +// 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: } { +// CHECK:STDOUT: %.loc13_14.1: @F.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc13_14: @F.%.1 (%.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.%.1 (%.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc13_25: @F.%.1 (%.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: } -// CHECK:STDOUT: %.loc13_29: @I.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] +// CHECK:STDOUT: %.loc13: @I.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .F = %.loc13_29 +// CHECK:STDOUT: .F = %.loc13 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc11_13.2: type, @I.%Self.1: @I.%.1 (%.2)) { +// CHECK:STDOUT: generic fn @F(@I.%T.loc11: type, @I.%Self.1: @I.%.1 (%.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.1: type = interface_type @I, @I(%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@I.%self.loc13_8.2: @F.%Self (%Self)]() -> @F.%Self (%Self); +// CHECK:STDOUT: fn[%self: @F.%Self (%Self)]() -> @F.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%T.loc22_6.2: type, @I.%Self.1: @I.%.1 (%.2)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.1: type = interface_type @I, @I(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: generic fn @.1(%T.loc22: type, @I.%Self.1: @I.%.1 (%.2)) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.1: type = interface_type @I, @I(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -121,7 +127,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.2 @@ -133,7 +139,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@F.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) { @@ -142,16 +148,16 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@I.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @I(@I.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@.1.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @I(@.1.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%Self) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: %.1 => constants.%.2 // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon index c3e9a7319697..3b4e57e89894 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon @@ -40,14 +40,14 @@ interface Modifiers { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Modifiers = %Modifiers.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Modifiers.decl: type = interface_decl @Modifiers [template = constants.%.1] {} +// CHECK:STDOUT: %Modifiers.decl: type = interface_decl @Modifiers [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Modifiers { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %Final.decl: %Final.type = fn_decl @Final [template = constants.%Final] {} +// CHECK:STDOUT: %Final.decl: %Final.type = fn_decl @Final [template = constants.%Final] {} {} // CHECK:STDOUT: %.loc16: %.3 = assoc_entity element0, %Final.decl [template = constants.%.4] -// CHECK:STDOUT: %Default.decl: %Default.type = fn_decl @Default [template = constants.%Default] {} +// CHECK:STDOUT: %Default.decl: %Default.type = fn_decl @Default [template = constants.%Default] {} {} // CHECK:STDOUT: %.loc20: %.5 = assoc_entity element1, %Default.decl [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index f7174dae9202..6f57dd91499d 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -112,43 +112,54 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: .Pass = %Pass.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Simple.decl: %Simple.type = interface_decl @Simple [template = constants.%Simple] { -// CHECK:STDOUT: %T.loc4_18.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T 0, %T.loc4_18.1 [symbolic = @Simple.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %WithAssocFn.decl: %WithAssocFn.type = interface_decl @WithAssocFn [template = constants.%WithAssocFn] { -// CHECK:STDOUT: %T.loc8_23.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_23.2: type = bind_symbolic_name T 0, %T.loc8_23.1 [symbolic = @WithAssocFn.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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.loc22_28.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc22_28.2: type = bind_symbolic_name T 0, %T.loc22_28.1 [symbolic = @WithImplicitArgs.%T (constants.%T.1)] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.2 [symbolic = @WithImplicitArgs.%T (constants.%T.1)] -// CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T (%T.1) = param N, runtime_param -// CHECK:STDOUT: %N.loc22_38.2: @WithImplicitArgs.%T (%T.1) = bind_symbolic_name N 1, %N.loc22_38.1 [symbolic = @WithImplicitArgs.%N (constants.%N)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: %N.patt: @WithImplicitArgs.%T.1 (%T.1) = symbolic_binding_pattern N 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc22: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22 [symbolic = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %N.param: @WithImplicitArgs.%T.1 (%T.1) = param N, runtime_param +// CHECK:STDOUT: %N.loc22: @WithImplicitArgs.%T.1 (%T.1) = bind_symbolic_name N 1, %N.param [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [template = constants.%Receive] { -// CHECK:STDOUT: %Simple.ref.loc24: %Simple.type = name_ref Simple, %Simple.decl [template = constants.%Simple] -// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %T.patt: %.8 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Simple.ref: %Simple.type = 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: %.loc24: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] -// CHECK:STDOUT: %T.loc24_12.1: %.8 = param T, runtime_param -// CHECK:STDOUT: @Receive.%T.loc24: %.8 = bind_symbolic_name T 0, %T.loc24_12.1 [symbolic = @Receive.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.param: %.8 = param T, runtime_param +// CHECK:STDOUT: %T.loc24: %.8 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [template = constants.%Pass] { -// CHECK:STDOUT: %Simple.ref.loc25: %Simple.type = name_ref Simple, %Simple.decl [template = constants.%Simple] -// CHECK:STDOUT: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %T.patt: %.8 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Simple.ref: %Simple.type = 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: %.loc25: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] -// CHECK:STDOUT: %T.loc25_9.1: %.8 = param T, runtime_param -// CHECK:STDOUT: @Pass.%T.loc25: %.8 = bind_symbolic_name T 0, %T.loc25_9.1 [symbolic = @Pass.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.param: %.8 = param T, runtime_param +// CHECK:STDOUT: %T.loc25: %.8 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Simple(file.%T.loc4_18.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @Simple(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Simple, @Simple(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @Simple, @Simple(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -160,22 +171,22 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @WithAssocFn(file.%T.loc8_23.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @WithAssocFn(%T.loc8: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @WithAssocFn, @WithAssocFn(%T) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @WithAssocFn, @WithAssocFn(%T.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] -// CHECK:STDOUT: %F.type: type = fn_type @F.1, @WithAssocFn(%T) [symbolic = %F.type (constants.%F.type.1)] +// CHECK:STDOUT: %F.type: type = fn_type @F.1, @WithAssocFn(%T.1) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @WithAssocFn.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: %.2: type = assoc_entity_type @WithAssocFn.%.1 (%.5), @WithAssocFn.%F.type (%F.type.1) [symbolic = %.2 (constants.%.6)] // CHECK:STDOUT: %.3: @WithAssocFn.%.2 (%.6) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @WithAssocFn.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] -// CHECK:STDOUT: %F.decl: @WithAssocFn.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = %F (constants.%F.1)] { +// CHECK:STDOUT: %F.decl: @WithAssocFn.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @WithAssocFn.%F (constants.%F.1)] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %return.var: ref %X = var +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10: @WithAssocFn.%.2 (%.6) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: @@ -186,30 +197,30 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @WithImplicitArgs(file.%T.loc22_28.2: type, file.%N.loc22_38.2: @WithImplicitArgs.%T (%T.1)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] -// CHECK:STDOUT: %N: %T.1 = bind_symbolic_name N 1 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: generic interface @WithImplicitArgs(%T.loc22: type, %N.loc22: @WithImplicitArgs.%T.1 (%T.1)) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] +// CHECK:STDOUT: %N.1: %T.1 = bind_symbolic_name N 1 [symbolic = %N.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.8 { -// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: %.loc14_21: = interface_witness () [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc14 +// CHECK:STDOUT: witness = %.loc14_21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.10 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %return.var: ref %X = var +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%F.decl) [template = constants.%.13] +// CHECK:STDOUT: %.loc15_26: = interface_witness (%F.decl) [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -220,15 +231,15 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: impl_decl @impl.1 { +// CHECK:STDOUT: impl_decl @impl.1 {} { // CHECK:STDOUT: %Simple.ref: %Simple.type = name_ref Simple, file.%Simple.decl [template = constants.%Simple] -// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc14: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc14_17: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { +// CHECK:STDOUT: impl_decl @impl.2 {} { // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type = name_ref WithAssocFn, file.%WithAssocFn.decl [template = constants.%WithAssocFn] -// CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc15: type = interface_type @WithAssocFn, @WithAssocFn(constants.%C) [template = constants.%.10] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc15_22: type = interface_type @WithAssocFn, @WithAssocFn(constants.%C) [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -236,17 +247,17 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(file.%T.loc8_23.2: type, @WithAssocFn.%Self.1: @WithAssocFn.%.1 (%.5)) { +// CHECK:STDOUT: generic fn @F.1(@WithAssocFn.%T.loc8: type, @WithAssocFn.%Self.1: @WithAssocFn.%.1 (%.5)) { // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %X; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() -> @impl.2.%return.var: %X { +// CHECK:STDOUT: fn @F.2() -> %return: %X { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc17_15.1: %.3 = struct_literal () -// CHECK:STDOUT: %.loc17_15.2: init %X = class_init (), @impl.2.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc17_15.2: init %X = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc17_16: init %X = converted %.loc17_15.1, %.loc17_15.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc17_16 to @impl.2.%return.var +// CHECK:STDOUT: return %.loc17_16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Receive(%T.loc24: %.8) { @@ -270,25 +281,25 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Simple(@Simple.%T) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: specific @Simple(@Simple.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => 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) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: specific @WithAssocFn(@WithAssocFn.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(constants.%C) { -// CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.1 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.8 @@ -296,7 +307,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(constants.%C) { -// CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.1 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.10 @@ -310,8 +321,8 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: specific @F.1(constants.%C, constants.%C) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @WithImplicitArgs(constants.%T.1, constants.%N) { -// CHECK:STDOUT: %T => constants.%T.1 -// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %T.1 => constants.%T.1 +// CHECK:STDOUT: %N.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Receive(constants.%T.2) { @@ -354,32 +365,38 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl: %Generic.type = interface_decl @Generic [template = constants.%Generic] { -// CHECK:STDOUT: %T.loc4_19.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T 0, %T.loc4_19.1 [symbolic = @Generic.%T (constants.%T.1)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (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: %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: %Generic.ref.loc9: %Generic.type = name_ref Generic, %Generic.decl [template = constants.%Generic] -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] +// CHECK:STDOUT: %T.patt: %.5 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Generic.ref: %Generic.type = 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: %.loc9: type = interface_type @Generic, @Generic(constants.%A) [template = constants.%.5] -// CHECK:STDOUT: %T.loc9_6.1: %.5 = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc9: %.5 = bind_symbolic_name T 0, %T.loc9_6.1 [symbolic = @F.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.param: %.5 = param T, runtime_param +// CHECK:STDOUT: %T.loc9: %.5 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Generic.ref.loc10: %Generic.type = name_ref Generic, %Generic.decl [template = constants.%Generic] -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] +// CHECK:STDOUT: %T.patt: %.6 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Generic.ref: %Generic.type = 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: %.loc10: type = interface_type @Generic, @Generic(constants.%B) [template = constants.%.6] -// CHECK:STDOUT: %T.loc10_6.1: %.6 = param T, runtime_param -// CHECK:STDOUT: @G.%T.loc10: %.6 = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = @G.%T.1 (constants.%T.3)] +// CHECK:STDOUT: %T.param: %.6 = param T, runtime_param +// CHECK:STDOUT: %T.loc10: %.6 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Generic(file.%T.loc4_19.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] +// CHECK:STDOUT: generic interface @Generic(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Generic, @Generic(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @Generic, @Generic(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -426,15 +443,15 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(@Generic.%T) { -// CHECK:STDOUT: %T => constants.%T.1 +// CHECK:STDOUT: specific @Generic(@Generic.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%A) { -// CHECK:STDOUT: %T => constants.%A +// CHECK:STDOUT: %T.1 => constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.2) { @@ -442,7 +459,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%B) { -// CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.1 => constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T.3) { 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 8233be7d7ed4..bace51e82095 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 @@ -39,21 +39,25 @@ interface I { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.loc12_8.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_8.2: type = bind_symbolic_name T 1, %T.loc12_8.1 [symbolic = @F.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc12: type = bind_symbolic_name T 1, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %U: type = assoc_const_decl U [template] // CHECK:STDOUT: %.loc13: %.5 = assoc_entity element1, %U [template = constants.%.6] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.loc16_8.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc16_8.2: type = bind_symbolic_name T 1, %T.loc16_8.1 [symbolic = @G.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc16: type = bind_symbolic_name T 1, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: %.7 = assoc_entity element2, %G.decl [template = constants.%.8] // CHECK:STDOUT: @@ -65,16 +69,16 @@ interface I { // CHECK:STDOUT: witness = (%F.decl, %U, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@I.%Self: %.1, @I.%T.loc12_8.2: type) { +// CHECK:STDOUT: generic fn @F(@I.%Self: %.1, %T.loc12: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 1 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@I.%T.loc12_8.2: type); +// CHECK:STDOUT: fn(%T.loc12: type); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(@I.%Self: %.1, @I.%T.loc16_8.2: type) { +// CHECK:STDOUT: generic fn @G(@I.%Self: %.1, %T.loc16: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 1 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@I.%T.loc16_8.2: type); +// CHECK:STDOUT: fn(%T.loc16: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self, constants.%T) { diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 8a196140d3e7..2b0da5c85ffc 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -47,25 +47,27 @@ impl C as AddWith(C) { // CHECK:STDOUT: .AddWith = %AddWith.decl // CHECK:STDOUT: } // CHECK:STDOUT: %AddWith.decl: %AddWith.type = interface_decl @AddWith [template = constants.%AddWith] { -// CHECK:STDOUT: %T.loc4_19.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T 0, %T.loc4_19.1 [symbolic = @AddWith.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @AddWith(file.%T.loc4_19.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @AddWith(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @AddWith, @AddWith(%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = interface_type @AddWith, @AddWith(%T.1) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %F.type: type = fn_type @F, @AddWith(%T) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @AddWith(%T.1) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @AddWith.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: %.2: type = assoc_entity_type @AddWith.%.1 (%.2), @AddWith.%F.type (%F.type) [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: %.3: @AddWith.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @AddWith.%.1 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %F.decl: @AddWith.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] {} +// CHECK:STDOUT: %F.decl: @AddWith.%F.type (%F.type) = fn_decl @F [symbolic = @AddWith.%F (constants.%F)] {} {} // CHECK:STDOUT: %.loc5: @AddWith.%.2 (%.3) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -75,19 +77,19 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(file.%T.loc4_19.2: type, @AddWith.%Self.1: @AddWith.%.1 (%.2)) { +// CHECK:STDOUT: generic fn @F(@AddWith.%T.loc4: type, @AddWith.%Self.1: @AddWith.%.1 (%.2)) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith(@AddWith.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @AddWith(@AddWith.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -118,11 +120,11 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %AddWith.type = import_ref Main//a, inst+4, loaded [template = constants.%AddWith] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+10, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+16, unloaded -// CHECK:STDOUT: %import_ref.4: @AddWith.%F.type (%F.type.1) = import_ref Main//a, inst+12, loaded [symbolic = @AddWith.%F (constants.%F.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+12, unloaded +// CHECK:STDOUT: %import_ref.1: %AddWith.type = 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -131,12 +133,12 @@ impl C as AddWith(C) { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc7_6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref.loc7_6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %AddWith.ref: %AddWith.type = name_ref AddWith, imports.%import_ref.1 [template = constants.%AddWith] -// CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc7: type = interface_type @AddWith, @AddWith(constants.%C) [template = constants.%.7] +// CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc7_18: type = interface_type @AddWith, @AddWith(constants.%C) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -160,12 +162,12 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.7 { -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc7: = interface_witness (%F.decl) [template = constants.%.10] +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} +// CHECK:STDOUT: %.loc7_22: = interface_witness (%F.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %.loc7 +// CHECK:STDOUT: witness = %.loc7_22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 5eb685772fde..a47d9a4e9090 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -93,47 +93,51 @@ interface A(T: type) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %NotGenericNoParams.decl: type = interface_decl @NotGenericNoParams [template = constants.%.1] {} -// CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type = interface_decl @NotGenericButParams [template = constants.%NotGenericButParams] {} +// CHECK:STDOUT: %NotGenericNoParams.decl: type = interface_decl @NotGenericNoParams [template = constants.%.1] {} {} +// CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type = interface_decl @NotGenericButParams [template = constants.%NotGenericButParams] {} {} // CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.1 = interface_decl @GenericAndParams.1 [template = constants.%GenericAndParams.1] { -// CHECK:STDOUT: %T.loc6_28.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_28.2: type = bind_symbolic_name T 0, %T.loc6_28.1 [symbolic = @GenericAndParams.1.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.loc8_9.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T 0, %T.loc8_9.1 [symbolic = @C.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc8: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %X.ref.loc14: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, %NotGenericNoParams.decl [template = constants.%.1] +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, file.%NotGenericNoParams.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %X.ref.loc15: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type = name_ref NotGenericButParams, %NotGenericButParams.decl [template = constants.%NotGenericButParams] -// CHECK:STDOUT: %.loc15: type = interface_type @NotGenericButParams [template = constants.%.3] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type = name_ref NotGenericButParams, file.%NotGenericButParams.decl [template = constants.%NotGenericButParams] +// CHECK:STDOUT: %.loc15_30: type = interface_type @NotGenericButParams [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.3 { -// CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %GenericAndParams.ref.loc16: %GenericAndParams.type.1 = name_ref GenericAndParams, %GenericAndParams.decl [template = constants.%GenericAndParams.1] -// CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc16: type = interface_type @GenericAndParams.1, @GenericAndParams.1(constants.%X) [template = constants.%.11] +// CHECK:STDOUT: impl_decl @impl.3 {} { +// CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.1 = name_ref GenericAndParams, file.%GenericAndParams.decl [template = constants.%GenericAndParams.1] +// CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %.loc16_27: type = interface_type @GenericAndParams.1, @GenericAndParams.1(constants.%X) [template = constants.%.11] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.4 { -// CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.ref.loc17: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %X.ref.loc17_13: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.loc17: type = class_type @C, @C(constants.%X) [template = constants.%C.3] +// CHECK:STDOUT: impl_decl @impl.4 {} { +// CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] +// CHECK:STDOUT: %X.ref.loc17_13: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.3] // CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, @C.%GenericNoParams.decl [template = constants.%.5] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.5 { -// CHECK:STDOUT: %X.ref.loc18_6: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.ref.loc18: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %X.ref.loc18_13: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.loc18: type = class_type @C, @C(constants.%X) [template = constants.%C.3] +// CHECK:STDOUT: impl_decl @impl.5 {} { +// CHECK:STDOUT: %X.ref.loc18_6: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] +// CHECK:STDOUT: %X.ref.loc18_13: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.3] // CHECK:STDOUT: %.loc18_15: %GenericAndParams.type.3 = specific_constant @C.%GenericAndParams.decl, @C(constants.%X) [template = constants.%GenericAndParams.3] -// CHECK:STDOUT: %GenericAndParams.ref.loc18: %GenericAndParams.type.3 = name_ref GenericAndParams, %.loc18_15 [template = constants.%GenericAndParams.3] -// CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, %X.decl [template = constants.%X] +// CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.3 = name_ref GenericAndParams, %.loc18_15 [template = constants.%GenericAndParams.3] +// CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc18_32: type = interface_type @GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X) [template = constants.%.13] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -154,11 +158,11 @@ interface A(T: type) {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @GenericAndParams.1(file.%T.loc6_28.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic interface @GenericAndParams.1(%T.loc6: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%T.1) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.3)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -170,7 +174,7 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @GenericNoParams(file.%T.loc8_9.2: type) { +// CHECK:STDOUT: generic interface @GenericNoParams(@C.%T.loc8: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.1: type = interface_type @GenericNoParams, @GenericNoParams(%T) [symbolic = %.1 (constants.%.6)] @@ -185,12 +189,12 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @GenericAndParams.2(file.%T.loc8_9.2: type, @C.%U.loc10_30.2: type) { -// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)] +// CHECK:STDOUT: generic interface @GenericAndParams.2(@C.%T.loc8: type, %U.loc10: type) { +// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.1: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %.1: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%T, %U.1) [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 2 [symbolic = %Self.2 (constants.%Self.5)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -210,17 +214,17 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X as %.3 { -// CHECK:STDOUT: %.loc15: = interface_witness () [template = constants.%.10] +// CHECK:STDOUT: %.loc15_33: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %X as %.11 { -// CHECK:STDOUT: %.loc16: = interface_witness () [template = constants.%.10] +// CHECK:STDOUT: %.loc16_31: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc16 +// CHECK:STDOUT: witness = %.loc16_31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %X as %.5 { @@ -231,24 +235,26 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.5: %X as %.13 { -// CHECK:STDOUT: %.loc18: = interface_witness () [template = constants.%.10] +// CHECK:STDOUT: %.loc18_36: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %.loc18 +// CHECK:STDOUT: witness = %.loc18_36 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%T.loc8_9.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C(%T.loc8: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %GenericAndParams.type: type = generic_interface_type @GenericAndParams.2, @C(%T) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] +// CHECK:STDOUT: %GenericAndParams.type: type = generic_interface_type @GenericAndParams.2, @C(%T.1) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] // CHECK:STDOUT: %GenericAndParams: @C.%GenericAndParams.type (%GenericAndParams.type.2) = struct_value () [symbolic = %GenericAndParams (constants.%GenericAndParams.2)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %GenericNoParams.decl: type = interface_decl @GenericNoParams [template = constants.%.5] {} -// CHECK:STDOUT: %GenericAndParams.decl: @C.%GenericAndParams.type (%GenericAndParams.type.2) = interface_decl @GenericAndParams.2 [symbolic = %GenericAndParams (constants.%GenericAndParams.2)] { -// CHECK:STDOUT: %U.loc10_30.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc10_30.2: type = bind_symbolic_name U 1, %U.loc10_30.1 [symbolic = @GenericAndParams.2.%U (constants.%U)] +// CHECK:STDOUT: %GenericNoParams.decl: type = interface_decl @GenericNoParams [template = constants.%.5] {} {} +// CHECK:STDOUT: %GenericAndParams.decl: @C.%GenericAndParams.type (%GenericAndParams.type.2) = interface_decl @GenericAndParams.2 [symbolic = @C.%GenericAndParams (constants.%GenericAndParams.2)] { +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U 1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.param: type = param U, runtime_param +// CHECK:STDOUT: %U.loc10: type = bind_symbolic_name U 1, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: @@ -267,15 +273,15 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericAndParams.1(@GenericAndParams.1.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @GenericAndParams.1(@GenericAndParams.1.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericNoParams(constants.%T) {} @@ -283,19 +289,19 @@ interface A(T: type) {} // CHECK:STDOUT: specific @GenericNoParams(@GenericNoParams.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%T, constants.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericAndParams.2(@GenericAndParams.2.%T, @GenericAndParams.2.%U) { -// CHECK:STDOUT: %U => constants.%U +// CHECK:STDOUT: specific @GenericAndParams.2(@GenericAndParams.2.%T, @GenericAndParams.2.%U.1) { +// CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@C.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @C(@C.%T.1) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { -// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %T.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.1 => constants.%.11 @@ -303,7 +309,7 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { -// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %T.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.3 @@ -311,7 +317,7 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%X, constants.%X) { -// CHECK:STDOUT: %U => constants.%X +// CHECK:STDOUT: %U.1 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X @@ -334,8 +340,10 @@ interface A(T: type) {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = interface_decl @A [template = constants.%A] { -// CHECK:STDOUT: %T.loc8_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_13.2: type = bind_name T, %T.loc8_13.1 +// CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %T.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -362,8 +370,10 @@ interface A(T: type) {} // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = interface_decl @A [template = constants.%A] { -// CHECK:STDOUT: %T.loc7_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_13.2: type = bind_name T, %T.loc7_13.1 +// CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %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 a2a1155c1b28..a0a4e4807315 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -81,9 +81,9 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl // CHECK:STDOUT: .f_ref = %f_ref // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} -// CHECK:STDOUT: %Basic.decl: type = interface_decl @Basic [template = constants.%.2] {} -// CHECK:STDOUT: %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [template = constants.%.8] {} +// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {} +// CHECK:STDOUT: %Basic.decl: type = interface_decl @Basic [template = constants.%.2] {} {} +// CHECK:STDOUT: %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [template = constants.%.8] {} {} // CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, %ForwardDeclared.decl [template = constants.%.8] // CHECK:STDOUT: %.loc20: type = struct_type {.f: %.8} [template = constants.%.13] // CHECK:STDOUT: %f_ref.var: ref %.13 = var f_ref @@ -102,7 +102,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %.loc8: %.3 = assoc_entity element0, %T [template = constants.%.4] -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} +// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %.loc9: %.6 = assoc_entity element1, %F.decl [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -116,7 +116,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 0 [symbolic = constants.%Self.3] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %.loc16: %.9 = assoc_entity element0, %T [template = constants.%.10] -// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %.loc17: %.11 = assoc_entity element1, %F.decl [template = constants.%.12] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -208,23 +208,29 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .UseBasicF = %UseBasicF // CHECK:STDOUT: .UseForwardDeclaredT = %UseForwardDeclaredT // CHECK:STDOUT: .UseForwardDeclaredF = %UseForwardDeclaredF -// CHECK:STDOUT: .f = %f.loc16 +// CHECK:STDOUT: .f = %f // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { +// CHECK:STDOUT: %e.patt: %.1 = binding_pattern e +// CHECK:STDOUT: } { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%.1] -// CHECK:STDOUT: %e.loc6_13.1: %.1 = param e, runtime_param0 -// CHECK:STDOUT: @UseEmpty.%e: %.1 = bind_name e, %e.loc6_13.1 +// CHECK:STDOUT: %e.param: %.1 = param e, runtime_param0 +// CHECK:STDOUT: %e: %.1 = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseBasic.decl: %UseBasic.type = fn_decl @UseBasic [template = constants.%UseBasic] { -// CHECK:STDOUT: %Basic.ref.loc7: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] -// CHECK:STDOUT: %e.loc7_13.1: %.3 = param e, runtime_param0 -// CHECK:STDOUT: @UseBasic.%e: %.3 = bind_name e, %e.loc7_13.1 +// CHECK:STDOUT: %e.patt: %.3 = binding_pattern e +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Basic.ref: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] +// CHECK:STDOUT: %e.param: %.3 = param e, runtime_param0 +// CHECK:STDOUT: %e: %.3 = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseForwardDeclared.decl: %UseForwardDeclared.type = fn_decl @UseForwardDeclared [template = constants.%UseForwardDeclared] { -// CHECK:STDOUT: %ForwardDeclared.ref.loc8: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] -// CHECK:STDOUT: %f.loc8_23.1: %.4 = param f, runtime_param0 -// CHECK:STDOUT: @UseForwardDeclared.%f: %.4 = bind_name f, %f.loc8_23.1 +// CHECK:STDOUT: %f.patt: %.4 = binding_pattern f +// CHECK:STDOUT: } { +// CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] +// CHECK:STDOUT: %f.param: %.4 = param f, runtime_param0 +// CHECK:STDOUT: %f: %.4 = bind_name f, %f.param // CHECK:STDOUT: } // CHECK:STDOUT: %Basic.ref.loc10: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] // CHECK:STDOUT: %T.ref.loc10: %.5 = name_ref T, imports.%import_ref.7 [template = constants.%.6] @@ -241,7 +247,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] // CHECK:STDOUT: %.loc16: type = ptr_type %.4 [template = constants.%.13] // CHECK:STDOUT: %f.var: ref %.13 = var f -// CHECK:STDOUT: %f.loc16: ref %.13 = bind_name f, %f.var +// CHECK:STDOUT: %f: ref %.13 = bind_name f, %f.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 25b7e375497c..a345a9912a53 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -151,7 +151,7 @@ private interface Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Def [private] = %Def.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Def.decl: type = interface_decl @Def [template = constants.%.1] {} +// CHECK:STDOUT: %Def.decl: type = interface_decl @Def [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Def { @@ -173,8 +173,8 @@ private interface Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = interface_decl @ForwardWithDef [template = constants.%.1] {} -// CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = interface_decl @ForwardWithDef [template = constants.%.1] {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = interface_decl @ForwardWithDef [template = constants.%.1] {} {} +// CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = interface_decl @ForwardWithDef [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @ForwardWithDef { @@ -214,9 +214,11 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %i.patt: %.1 = binding_pattern i +// CHECK:STDOUT: } { // CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%.1] -// CHECK:STDOUT: %i.loc4_6.1: %.1 = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: %.1 = bind_name i, %i.loc4_6.1 +// CHECK:STDOUT: %i.param: %.1 = param i, runtime_param0 +// CHECK:STDOUT: %i: %.1 = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -245,9 +247,11 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] -// CHECK:STDOUT: %i.loc10_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -277,10 +281,12 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] -// CHECK:STDOUT: %i.loc10_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -312,9 +318,11 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %i.patt: %.1 = binding_pattern i +// CHECK:STDOUT: } { // CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%.1] -// CHECK:STDOUT: %i.loc4_6.1: %.1 = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: %.1 = bind_name i, %i.loc4_6.1 +// CHECK:STDOUT: %i.param: %.1 = param i, runtime_param0 +// CHECK:STDOUT: %i: %.1 = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -343,9 +351,11 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] -// CHECK:STDOUT: %i.loc10_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -375,10 +385,12 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] -// CHECK:STDOUT: %i.loc10_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -405,12 +417,14 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // 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: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc8: type = ptr_type [template = ] -// CHECK:STDOUT: %i.loc8_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc8_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [template = constants.%.2] {} +// CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Forward { @@ -440,10 +454,12 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc10: type = ptr_type [template = ] -// CHECK:STDOUT: %i.loc10_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -473,10 +489,12 @@ private interface Redecl {} // CHECK:STDOUT: } // 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: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc9: type = ptr_type [template = ] -// CHECK:STDOUT: %i.loc9_6.1: = param i, runtime_param0 -// CHECK:STDOUT: @F.%i: = bind_name i, %i.loc9_6.1 +// CHECK:STDOUT: %i.param: = param i, runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -496,8 +514,8 @@ private interface Redecl {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4 // CHECK:STDOUT: } -// CHECK:STDOUT: %Redecl.decl.loc4: type = interface_decl @Redecl [template = constants.%.1] {} -// CHECK:STDOUT: %Redecl.decl.loc6: type = interface_decl @Redecl [template = constants.%.1] {} +// CHECK:STDOUT: %Redecl.decl.loc4: type = interface_decl @Redecl [template = constants.%.1] {} {} +// CHECK:STDOUT: %Redecl.decl.loc6: type = interface_decl @Redecl [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Redecl { diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon index 4fef8b10b8b3..dc70802ace6c 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon @@ -28,11 +28,11 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%.1] {} -// CHECK:STDOUT: impl_decl @impl { +// CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%.1] {} {} +// CHECK:STDOUT: impl_decl @impl {} { // CHECK:STDOUT: %.loc3_7.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc3_7.2: type = converted %.loc3_7.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%.1] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/self.carbon b/toolchain/check/testdata/interface/no_prelude/self.carbon index a2b4b2f4ceac..6f537074966e 100644 --- a/toolchain/check/testdata/interface/no_prelude/self.carbon +++ b/toolchain/check/testdata/interface/no_prelude/self.carbon @@ -28,34 +28,36 @@ interface UseSelf { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .UseSelf = %UseSelf.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} +// CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @UseSelf { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %self.loc12_8.1: @F.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_8.2: @F.%Self (%Self) = bind_name self, %self.loc12_8.1 -// CHECK:STDOUT: %Self.ref.loc12_25: %.1 = name_ref Self, %Self [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_25.1: type = facet_type_access %Self.ref.loc12_25 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_25.2: type = converted %Self.ref.loc12_25, %.loc12_25.1 [symbolic = @F.%Self (constants.%Self)] -// CHECK:STDOUT: %return.var: ref @F.%Self (%Self) = var +// CHECK:STDOUT: %self.patt: @F.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = 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: %.1 = 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: } -// CHECK:STDOUT: %.loc12_29: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %.loc12_29 +// CHECK:STDOUT: .F = %.loc12 // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(@UseSelf.%Self: %.1) { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[@UseSelf.%self.loc12_8.2: @F.%Self (%Self)]() -> @F.%Self (%Self); +// CHECK:STDOUT: fn[%self: @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 cecb238105e0..4469a13995e9 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -210,36 +210,44 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .Foo = %Foo.decl.loc7 // CHECK:STDOUT: .Bar = %Bar.decl.loc10 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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 = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc8_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_15.2: %C = bind_symbolic_name a 0, %a.loc8_15.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc10_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc10_15.2: %C = bind_symbolic_name a 0, %a.loc10_15.1 [symbolic = @Bar.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc10 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc11_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc11_15.2: %C = bind_symbolic_name a 0, %a.loc11_15.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc7_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a.1) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -251,11 +259,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Bar(file.%a.loc10_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Bar(%a.loc10: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Bar, @Bar(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @Bar, @Bar(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -275,19 +283,19 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(@Foo.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @Foo(@Foo.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Bar(@Bar.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @Bar(@Bar.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- spacing.carbon @@ -309,24 +317,28 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_21.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_21.2: %C = bind_symbolic_name a 0, %a.loc6_21.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc6 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_17.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_17.2: %C = bind_symbolic_name a 0, %a.loc7_17.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_21.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a.1) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -346,11 +358,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(@Foo.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @Foo(@Foo.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_parens.carbon @@ -374,30 +386,34 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc14_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc14_15.2: %C = bind_symbolic_name a 0, %a.loc14_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc14_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc14: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -417,15 +433,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon @@ -447,24 +463,28 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param.loc6 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = constants.%a] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a.1) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -484,11 +504,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(@Foo.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @Foo(@Foo.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.carbon @@ -512,29 +532,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc8_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_15.2: %C = bind_symbolic_name a 0, %a.loc8_15.1 [symbolic = @Bar.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc7_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Bar(file.%a.loc8_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Bar(%a.loc8: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -547,11 +571,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_two_file.impl.carbon @@ -579,8 +603,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+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: @@ -594,14 +618,18 @@ 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: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.loc12_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc12_15.2: %C = bind_symbolic_name a 0, %a.loc12_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %C = param a, runtime_param +// CHECK:STDOUT: %a.loc12: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc21: %.type.2 = interface_decl @.2 [template = constants.%.6] { +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.loc21_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc21_15.2: %C = bind_symbolic_name a 0, %a.loc21_15.1 [symbolic = @.2.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %C = param a, runtime_param +// CHECK:STDOUT: %a.loc21: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -611,11 +639,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc12_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc12: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -633,11 +661,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.2(file.%a.loc21_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.2(%a.loc21: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.2, @.2(%a) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %.1: type = interface_type @.2, @.2(%a.1) [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -659,11 +687,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { @@ -671,11 +699,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.2(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.2(@.2.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.2(@.2.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_name_mismatch.carbon @@ -701,32 +729,36 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %b.loc15_15.1: %C = param b, runtime_param -// CHECK:STDOUT: %b.loc15_15.2: %C = bind_symbolic_name b 0, %b.loc15_15.1 [symbolic = @.1.%b (constants.%b)] +// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b 0 +// 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: %C = bind_symbolic_name b 0, %b.param [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc7_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%b.loc15_15.2: %C) { -// CHECK:STDOUT: %b: %C = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] +// CHECK:STDOUT: generic interface @.1(%b.loc15: %C) { +// CHECK:STDOUT: %b.1: %C = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%b) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%b.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -746,15 +778,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%b) { -// CHECK:STDOUT: %b => constants.%b +// CHECK:STDOUT: specific @.1(@.1.%b.1) { +// CHECK:STDOUT: %b.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias.carbon @@ -779,32 +811,36 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a 0, %a.loc15_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc7_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc15_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc15: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -824,15 +860,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduced_alias.carbon @@ -857,32 +893,36 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %C.ref.loc5: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc15_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a 0, %a.loc15_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc7_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc7: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc15_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc15: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -902,15 +942,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- alias_two_file.carbon @@ -930,16 +970,18 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc6_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc6: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -952,7 +994,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias_two_file.impl.carbon @@ -973,7 +1015,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+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: @@ -988,9 +1030,11 @@ 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 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc17_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc17_15.2: %C = bind_symbolic_name a 0, %a.loc17_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a 0 +// 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: %C = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1000,11 +1044,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc17_15.2: %C) { -// CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc17: %C) { +// CHECK:STDOUT: %a.1: %C = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -1026,11 +1070,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_repeat_const.carbon @@ -1055,33 +1099,37 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// 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: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a 0 +// 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.loc6_15.1: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.2: %.3 = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc6: %.3 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a 0 +// 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.loc17_15.1: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc17_15.2: %.3 = bind_symbolic_name a 0, %a.loc17_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc17: %.3 = bind_symbolic_name a 0, %a.param [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %.3) { -// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(%a.loc6: %.3) { +// CHECK:STDOUT: %a.1: %.3 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc17_15.2: %.3) { -// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(%a.loc17: %.3) { +// CHECK:STDOUT: %a.1: %.3 = bind_symbolic_name a 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a.1) [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -1101,14 +1149,14 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(@.1.%a) { -// CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: specific @.1(@.1.%a.1) { +// CHECK:STDOUT: %a.1 => 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 1866820e7d62..daa85fd37800 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -65,30 +65,33 @@ interface I { // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc13: %.3 = assoc_entity element0, %F.decl [template = constants.%.4] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// 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.loc14_8.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a.loc14_8.2: i32 = bind_name a, %a.loc14_8.1 +// 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.loc14_16.1: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b.loc14_16.2: i32 = bind_name b, %b.loc14_16.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_31: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] +// CHECK:STDOUT: %.loc14: %.5 = assoc_entity element1, %G.decl [template = constants.%.6] // CHECK:STDOUT: %int.make_type_32.loc18_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc18_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_27: %.7 = tuple_literal (%int.make_type_32.loc18_19, %int.make_type_32.loc18_24) @@ -109,7 +112,7 @@ interface I { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %.loc13 -// CHECK:STDOUT: .G = %.loc14_31 +// CHECK:STDOUT: .G = %.loc14 // CHECK:STDOUT: .T = %.loc18_28.6 // CHECK:STDOUT: .N = %.loc19_19 // CHECK:STDOUT: witness = (%F.decl, %G.decl, %T, %N) @@ -128,7 +131,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@I.%Self: %.1) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(@I.%a.loc14_8.2: i32, @I.%b.loc14_16.2: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index b461d2e31243..a4920f8b88fe 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -44,7 +44,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 21a191ba405a..473272449758 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -167,14 +167,14 @@ fn F() -> T; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc5_14.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %return.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_12.2: type = converted %.loc10_12.1, constants.%.1 [template = constants.%.1] @@ -227,7 +227,7 @@ fn F() -> T; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -237,10 +237,10 @@ fn F() -> T; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] // CHECK:STDOUT: %.loc9_18: %.1 = converted %.loc9_17, %tuple [template = constants.%tuple] // CHECK:STDOUT: %x: %.1 = bind_name x, %.loc9_18 -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc10_14.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_14.2: type = converted %.loc10_14.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %return.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -297,7 +297,7 @@ fn F() -> T; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -308,12 +308,14 @@ fn F() -> T; // 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: } { // 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.loc10_8.1: %.2 = param b, runtime_param -// CHECK:STDOUT: %b.loc10_8.2: %.2 = bind_symbolic_name b 0, %b.loc10_8.1 [symbolic = @F.%b.1 (constants.%b)] +// CHECK:STDOUT: %b.param: %.2 = param b, runtime_param +// CHECK:STDOUT: %b.loc10: %.2 = bind_symbolic_name b 0, %b.param [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22_13: %.1 = tuple_literal () // CHECK:STDOUT: %.loc22_17: %.1 = tuple_literal () @@ -345,13 +347,13 @@ fn F() -> T; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@C.%b.loc10_8.2: %.2) { +// CHECK:STDOUT: generic fn @F(%b.loc10: %.2) { // CHECK:STDOUT: %b.1: %.2 = bind_symbolic_name b 0 [symbolic = %b.1 (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %c.1: %.7 = bind_symbolic_name c 1 [symbolic = %c.1 (constants.%c)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@C.%b.loc10_8.2: %.2) { +// CHECK:STDOUT: fn(%b.loc10: %.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_15: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_19: %.1 = tuple_literal () @@ -383,7 +385,7 @@ fn F() -> T; // 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, @C.%b.loc10_8.2 [symbolic = %b.1 (constants.%b)] +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, %b.loc10 [symbolic = %b.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] @@ -476,14 +478,14 @@ fn F() -> T; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc5_14.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %return.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc14_12.2: type = converted %.loc14_12.1, constants.%.1 [template = constants.%.1] @@ -500,8 +502,8 @@ fn F() -> T; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.1 = name_ref x, @C.%x // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] -// CHECK:STDOUT: %.loc5: %.1 = converted %x.ref, %tuple [template = constants.%tuple] -// CHECK:STDOUT: return %.loc5 +// CHECK:STDOUT: %.loc5_26: %.1 = converted %x.ref, %tuple [template = constants.%tuple] +// CHECK:STDOUT: return %.loc5_26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_in_function.carbon @@ -537,11 +539,11 @@ fn F() -> T; // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// 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: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -549,9 +551,9 @@ fn F() -> T; // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32, %.loc5_14.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] +// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5, %.loc5_14.1 [template = i32] // CHECK:STDOUT: %.loc5_20: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: %Zero: i32 = bind_symbolic_name Zero 0, %.loc5_20 [symbolic = constants.%Zero] // CHECK:STDOUT: %Zero.ref: i32 = name_ref Zero, %Zero [symbolic = constants.%Zero] @@ -604,12 +606,12 @@ fn F() -> T; // 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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -618,7 +620,7 @@ fn F() -> T; // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -628,20 +630,20 @@ fn F() -> T; // CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_32, %.loc5_21.1 [template = i32] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %.loc5_21.3: %.3 = assoc_entity element0, %T [template = constants.%.4] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.ref: %.3 = name_ref T, %.loc5_21.3 [template = constants.%.4] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %T.ref: %.3 = name_ref T, @I.%.loc5_21.3 [template = constants.%.4] // CHECK:STDOUT: %.loc13_13.1: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.8] // CHECK:STDOUT: %.loc13_13.2: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.10] // CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc13_13.2 [template = constants.%.10] // CHECK:STDOUT: %.loc13_13.3: type = converted %T.ref, [template = ] -// CHECK:STDOUT: %return.var: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_14: %.12 = assoc_entity element1, %F.decl [template = constants.%.13] +// CHECK:STDOUT: %.loc13: %.12 = assoc_entity element1, %F.decl [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .T = %.loc5_21.3 -// CHECK:STDOUT: .F = %.loc13_14 +// CHECK:STDOUT: .F = %.loc13 // CHECK:STDOUT: witness = (%T, %F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -745,7 +747,7 @@ fn F() -> T; // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = class_decl @I [template = constants.%I] {} +// CHECK:STDOUT: %I.decl: type = class_decl @I [template = constants.%I] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @I { @@ -753,9 +755,9 @@ fn F() -> T; // CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_32, %.loc9_21.1 [template = i32] // CHECK:STDOUT: %T: type = bind_name T, %.loc9_21.2 -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T -// CHECK:STDOUT: %return.var: ref = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -801,9 +803,9 @@ fn F() -> T; // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %T.ref: type = name_ref T, @__global_init.%T -// CHECK:STDOUT: @F.%return: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 27b62aa10aa3..fb8d7e1d7baf 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -53,11 +53,11 @@ fn F() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index fc18add9d374..090f1656b84a 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -52,7 +52,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 293c2cd6ce14..e597b03e936c 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -75,12 +75,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,15 +90,17 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc12_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc12_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -125,9 +127,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32, %.loc13_21.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13, %.loc13_21.1 [template = i32] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0, %.loc13_21.2 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %.loc21_14: i32 = int_literal 5 [template = constants.%.2] diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index c98fe70f9d88..d5fc64ebb9c7 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -57,7 +57,7 @@ fn F() { // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] // CHECK:STDOUT: %n: i32 = bind_name n, -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 83d6fdb30dca..2ab92fa810fb 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -46,7 +46,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index c8be9b449ef7..94063f49aa89 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -47,7 +47,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 822fc5b7278d..080341b12851 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -45,14 +45,14 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32, %.loc11_8.1 [template = i32] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index b6ce53420570..b1b251a2281d 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -45,15 +45,17 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc11_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc11_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -61,9 +63,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] +// 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: %a.ref: i32 = name_ref a, %a // CHECK:STDOUT: %b: i32 = bind_name b, %a.ref // CHECK:STDOUT: %b.ref: i32 = name_ref b, %b diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index cf00d57f939e..8e8521249a85 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -47,15 +47,17 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc11_6.1: i32 = param a, runtime_param0 -// CHECK:STDOUT: @F.%a.loc11: i32 = bind_name a, %a.loc11_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -63,9 +65,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.loc11: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] +// 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: %.loc12_16: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %a.loc12: i32 = bind_name a, %.loc12_16 // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a.loc12 diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index c0a0e90b5cb0..4400347be66e 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -85,15 +85,15 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: @A.%return: ref i32 = var +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32, %.loc4_14.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // 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] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32, %.loc6_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -102,8 +102,8 @@ var a: i32 = NS.A(); // CHECK:STDOUT: // CHECK:STDOUT: fn @A() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4: i32 = int_literal 0 [template = constants.%.2] -// CHECK:STDOUT: return %.loc4 +// CHECK:STDOUT: %.loc4_27: i32 = int_literal 0 [template = constants.%.2] +// CHECK:STDOUT: return %.loc4_27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 806b1adc6d4b..489b92b9a499 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -65,26 +65,26 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: } // CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15, %.loc15_14.1 [template = i32] -// CHECK:STDOUT: @A.%return: ref i32 = var +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32, %.loc15_14.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_32.loc17, %.loc17_11.1 [template = i32] -// CHECK:STDOUT: @B.%return: ref i32 = var +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_32, %.loc17_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %NS.ref.loc19: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %C: %A.type = bind_alias C, %A.decl [template = constants.%A] -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] { -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32.loc21, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: @D.%return: ref i32 = var +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -92,8 +92,8 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15: i32 = int_literal 0 [template = constants.%.2] -// CHECK:STDOUT: return %.loc15 +// CHECK:STDOUT: %.loc15_27: i32 = int_literal 0 [template = constants.%.2] +// CHECK:STDOUT: return %.loc15_27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() -> i32 { diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index ab243d8102a6..36d995eb9d57 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -104,9 +104,9 @@ fn NS(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %NS.loc8: = namespace [template] {} -// CHECK:STDOUT: %.decl.loc18: %.type.1 = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl.loc18: %.type.1 = fn_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: %NS.loc22: = namespace [template] {} -// CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.3] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index b9d0a31ecab7..579828c977f8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -89,8 +89,8 @@ fn NS.Foo(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index 23925d45825d..7c110cf0bf65 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -98,7 +98,7 @@ fn Other.Nested.F(); // CHECK:STDOUT: .Nested = imports.%Nested // CHECK:STDOUT: import Other//default // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 5adec5296b2e..76c84f2c4ee8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -66,7 +66,7 @@ fn NS.Foo(); // CHECK:STDOUT: .NS = %NS.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} +// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @NS(); @@ -103,7 +103,7 @@ fn NS.Foo(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc14: = namespace [template] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index dc30f52243bb..4d481b2a0b30 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -68,7 +68,7 @@ fn NS.Bar() {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { @@ -103,7 +103,7 @@ fn NS.Bar() {} // CHECK:STDOUT: .NS = %NS.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} +// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @NS() { @@ -146,7 +146,7 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} +// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bar() { diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index c1d40aa7c58f..08893a9efe04 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -65,7 +65,7 @@ fn NS.Bar() {} // CHECK:STDOUT: .NS = %NS.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} +// CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @NS() { @@ -103,7 +103,7 @@ fn NS.Bar() {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() { @@ -146,7 +146,7 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} +// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bar() { diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 308898decd08..798a8268a723 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -57,11 +57,11 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_32, %.loc22_14.1 [template = i32] -// CHECK:STDOUT: @.1.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -69,7 +69,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22: i32 = int_literal 0 [template = constants.%.3] -// CHECK:STDOUT: return %.loc22 +// CHECK:STDOUT: %.loc22_27: i32 = int_literal 0 [template = constants.%.3] +// CHECK:STDOUT: return %.loc22_27 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index 4cfa4f861256..82e2636aa5ac 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -52,8 +52,8 @@ fn Foo.Baz() { // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.decl.loc13 // CHECK:STDOUT: } -// CHECK:STDOUT: %Baz.decl.loc13: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} -// CHECK:STDOUT: %Baz.decl.loc22: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} +// CHECK:STDOUT: %Baz.decl.loc13: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} {} +// CHECK:STDOUT: %Baz.decl.loc22: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Baz() { diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index ff5faa26f643..5d6117f0826f 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -78,23 +78,23 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %A: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%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.loc24_13.1: i32 = param n, runtime_param -// CHECK:STDOUT: %n.loc24_13.2: i32 = bind_name n, %n.loc24_13.1 +// CHECK:STDOUT: %n.param: i32 = param n, runtime_param +// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %B: = namespace [template] {} -// CHECK:STDOUT: %T.loc30_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc30_13.2: type = bind_symbolic_name T 0, %T.loc30_13.1 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc30_13.2 [symbolic = constants.%T] -// CHECK:STDOUT: %x.loc30_23.1: %T = param x, runtime_param -// CHECK:STDOUT: %x.loc30_23.2: %T = bind_name x, %x.loc30_23.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: %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: %C: = namespace [template] {} // CHECK:STDOUT: %D: = namespace [template] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.loc39_6.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc39_6.2: type = bind_symbolic_name T 0, %T.loc39_6.1 [symbolic = @.1.%T (constants.%T)] +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc39: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -105,8 +105,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(file.%T.loc39_6.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic fn @.1(%T.loc39: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -117,6 +117,6 @@ fn D(T:! type).F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index d8750b098629..7eaf8888ebb3 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -40,7 +40,7 @@ fn Foo.Baz() { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1() { diff --git a/toolchain/check/testdata/namespace/function.carbon b/toolchain/check/testdata/namespace/function.carbon index afc4830bddef..9702fd86be25 100644 --- a/toolchain/check/testdata/namespace/function.carbon +++ b/toolchain/check/testdata/namespace/function.carbon @@ -57,9 +57,9 @@ fn Bar() { // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.decl.loc17 // CHECK:STDOUT: } -// CHECK:STDOUT: %Baz.decl.loc14: %Baz.type.1 = fn_decl @Baz.1 [template = constants.%Baz.1] {} -// CHECK:STDOUT: %Baz.decl.loc17: %Baz.type.2 = fn_decl @Baz.2 [template = constants.%Baz.2] {} -// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} +// CHECK:STDOUT: %Baz.decl.loc14: %Baz.type.1 = fn_decl @Baz.1 [template = constants.%Baz.1] {} {} +// CHECK:STDOUT: %Baz.decl.loc17: %Baz.type.2 = fn_decl @Baz.2 [template = constants.%Baz.2] {} {} +// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Baz.1() { diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index 4b27db140c2c..db35a14298da 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -64,8 +64,8 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %ChildNS: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// 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: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 361f120ceee5..ecf281c0b69b 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -168,7 +168,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D() { diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index cad41928f233..1e319f3b0aaf 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -76,7 +76,7 @@ fn Run() { // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { @@ -117,12 +117,12 @@ fn Run() { // CHECK:STDOUT: .B1 = %B1.decl // CHECK:STDOUT: .B2 = %B2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B1.decl: %B1.type = fn_decl @B1 [template = constants.%B1] {} +// CHECK:STDOUT: %B1.decl: %B1.type = fn_decl @B1 [template = constants.%B1] {} {} // CHECK:STDOUT: %NS.loc8: = namespace [template] { // CHECK:STDOUT: .B1 = %B1.decl // CHECK:STDOUT: .B2 = %B2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B2.decl: %B2.type = fn_decl @B2 [template = constants.%B2] {} +// CHECK:STDOUT: %B2.decl: %B2.type = fn_decl @B2 [template = constants.%B2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B1() { @@ -188,8 +188,8 @@ fn Run() { // CHECK:STDOUT: .B2 = imports.%import_ref.4 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C() { diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index b5c1c8c2c838..6161b6cac1a1 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -71,7 +71,7 @@ fn Run() { // CHECK:STDOUT: %NS1: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -127,11 +127,11 @@ fn Run() { // CHECK:STDOUT: .A = imports.%import_ref.2 // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// 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: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %NS1.ref: = name_ref NS1, imports.%NS1 [template = imports.%NS1] // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: @F.%return: ref %A = var +// CHECK:STDOUT: %return: ref %A = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -205,7 +205,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { diff --git a/toolchain/check/testdata/namespace/nested.carbon b/toolchain/check/testdata/namespace/nested.carbon index 72bd14753be5..086da226af27 100644 --- a/toolchain/check/testdata/namespace/nested.carbon +++ b/toolchain/check/testdata/namespace/nested.carbon @@ -54,8 +54,8 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: .Wiz = %Wiz.decl // CHECK:STDOUT: .Baz = %Baz.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Wiz.decl: %Wiz.type = fn_decl @Wiz [template = constants.%Wiz] {} -// CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} +// CHECK:STDOUT: %Wiz.decl: %Wiz.type = fn_decl @Wiz [template = constants.%Wiz] {} {} +// CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Wiz() { diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index b927644a2e37..61e8696005cd 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -65,20 +65,20 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: .N = %N // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl.loc11: %A.type.1 = fn_decl @A.1 [template = constants.%A.1] {} +// CHECK:STDOUT: %A.decl.loc11: %A.type.1 = fn_decl @A.1 [template = constants.%A.1] {} {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .A = %A.decl.loc14 // CHECK:STDOUT: .M = %M // CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl.loc14: %A.type.2 = fn_decl @A.2 [template = constants.%A.2] {} +// CHECK:STDOUT: %A.decl.loc14: %A.type.2 = fn_decl @A.2 [template = constants.%A.2] {} {} // CHECK:STDOUT: %M: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32] -// CHECK:STDOUT: @B.%return: ref i32 = var +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { +// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] +// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32.loc18, %.loc18_15.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -96,9 +96,9 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: if %.loc21 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_12.2: type = converted %int.make_type_32, %.loc22_12.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc22_12.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] +// CHECK:STDOUT: %.loc22_12.2: type = converted %int.make_type_32.loc22, %.loc22_12.1 [template = i32] // CHECK:STDOUT: %A.var: ref i32 = var A // CHECK:STDOUT: %A: ref i32 = bind_name A, %A.var // CHECK:STDOUT: %.loc22_18: i32 = int_literal 0 [template = constants.%.3] diff --git a/toolchain/check/testdata/namespace/unqualified_lookup.carbon b/toolchain/check/testdata/namespace/unqualified_lookup.carbon index 7dc6345f25a6..525c64bb34fd 100644 --- a/toolchain/check/testdata/namespace/unqualified_lookup.carbon +++ b/toolchain/check/testdata/namespace/unqualified_lookup.carbon @@ -78,12 +78,12 @@ fn OuterN.InnerN.CallABC() { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .CallABC = %CallABC.decl // CHECK:STDOUT: } -// 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: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %CallA.decl: %CallA.type = fn_decl @CallA [template = constants.%CallA] {} -// CHECK:STDOUT: %CallAB.decl: %CallAB.type = fn_decl @CallAB [template = constants.%CallAB] {} -// CHECK:STDOUT: %CallABC.decl: %CallABC.type = fn_decl @CallABC [template = constants.%CallABC] {} +// 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: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %CallA.decl: %CallA.type = fn_decl @CallA [template = constants.%CallA] {} {} +// CHECK:STDOUT: %CallAB.decl: %CallAB.type = fn_decl @CallAB [template = constants.%CallAB] {} {} +// CHECK:STDOUT: %CallABC.decl: %CallABC.type = fn_decl @CallABC [template = constants.%CallABC] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index cd493a68e7a6..d8da8c74be56 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -72,31 +72,33 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: .PartialConstant = %PartialConstant.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: @F.%return: ref bool = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// 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: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] -// CHECK:STDOUT: @G.%return: ref bool = var +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type, %.loc12_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_13.2: type = converted %bool.make_type.loc14, %.loc14_13.1 [template = bool] -// CHECK:STDOUT: @And.%return: ref bool = var +// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc14_13.2: type = converted %bool.make_type, %.loc14_13.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} +// 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: } { // 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.loc25_20.1: bool = param x, runtime_param0 -// CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc25_20.1 +// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,14 +106,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: bool = bool_literal true [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_25: bool = bool_literal true [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.2] -// CHECK:STDOUT: return %.loc12 +// CHECK:STDOUT: %.loc12_25: bool = bool_literal true [template = constants.%.2] +// CHECK:STDOUT: return %.loc12_25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @And() -> bool { @@ -277,9 +279,9 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: if %.loc26_19.2 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// 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: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc26_30.1: type = value_of_initializer %bool.make_type.loc26 [template = bool] +// CHECK:STDOUT: %.loc26_30.2: type = converted %bool.make_type.loc26, %.loc26_30.1 [template = bool] // CHECK:STDOUT: br !if.expr.result(%.loc26_30.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index b5a1c407860a..a34f5e0b919b 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -75,7 +75,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { 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 46db4938c922..373de6f8b3a9 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+35, 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+60.loc42_10(%.loc42_17) +// 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_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_ 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 5b2eec34b721..e1068ae15406 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 @@ -77,11 +77,13 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc4_23.2: type = converted %bool.make_type, %.loc4_23.1 [template = bool] -// CHECK:STDOUT: %x.loc4_20.1: bool = param x, runtime_param0 -// CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc4_20.1 +// CHECK:STDOUT: %x.patt: bool = binding_pattern x +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -181,11 +183,13 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %KnownValueButNonConstantCondition.decl: %KnownValueButNonConstantCondition.type = fn_decl @KnownValueButNonConstantCondition [template = constants.%KnownValueButNonConstantCondition] { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc4_41.2: type = converted %bool.make_type, %.loc4_41.1 [template = bool] -// CHECK:STDOUT: %x.loc4_38.1: bool = param x, runtime_param0 -// CHECK:STDOUT: @KnownValueButNonConstantCondition.%x: bool = bind_name x, %x.loc4_38.1 +// CHECK:STDOUT: %x.patt: bool = binding_pattern x +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon index 50c3bd144ce9..cbfcea0d2735 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -48,7 +48,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index ca2c8a420682..9467a7970122 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -106,13 +106,13 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 2806fb69998e..2c238a197f12 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -59,21 +59,21 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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 @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: i32 = int_literal 0 [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 0 [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 8ee194f02e9d..1913037e1a8c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -59,12 +59,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,7 +73,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { 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 9faab8cb42bf..7e983013fd8d 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -61,12 +61,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,7 +75,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { 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 371829335083..4cac7da308f5 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.%.4] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -66,11 +66,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 450463495ec4..6ecf61e41b54 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.%.4] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -60,11 +60,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index 64ce6858a05a..fa85b897238b 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -72,31 +72,33 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: .PartialConstant = %PartialConstant.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: @F.%return: ref bool = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// 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: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] -// CHECK:STDOUT: @G.%return: ref bool = var +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type, %.loc12_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_12.2: type = converted %bool.make_type.loc14, %.loc14_12.1 [template = bool] -// CHECK:STDOUT: @Or.%return: ref bool = var +// CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc14_12.2: type = converted %bool.make_type, %.loc14_12.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} +// 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: } { // 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.loc25_20.1: bool = param x, runtime_param0 -// CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc25_20.1 +// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,14 +106,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11: bool = bool_literal true [template = constants.%.2] -// CHECK:STDOUT: return %.loc11 +// CHECK:STDOUT: %.loc11_25: bool = bool_literal true [template = constants.%.2] +// CHECK:STDOUT: return %.loc11_25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.2] -// CHECK:STDOUT: return %.loc12 +// CHECK:STDOUT: %.loc12_25: bool = bool_literal true [template = constants.%.2] +// CHECK:STDOUT: return %.loc12_25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Or() -> bool { @@ -279,9 +281,9 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: if %.loc26_18.3 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc26_28.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc26_28.2: type = converted %bool.make_type, %.loc26_28.1 [template = bool] +// CHECK:STDOUT: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc26_28.1: type = value_of_initializer %bool.make_type.loc26 [template = bool] +// CHECK:STDOUT: %.loc26_28.2: type = converted %bool.make_type.loc26, %.loc26_28.1 [template = bool] // CHECK:STDOUT: br !if.expr.result(%.loc26_28.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index b10f6ed3aafe..12ae69dafdf6 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -60,15 +60,17 @@ fn Constant() { // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @Not.%b: bool = bind_name b, %b.loc11_8.1 +// 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: @Not.%return: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // 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] @@ -76,7 +78,7 @@ fn Constant() { // CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_16.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] // CHECK:STDOUT: %.loc16_16.2: type = converted %bool.make_type.loc16, %.loc16_16.1 [template = bool] -// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} +// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index b95e653b61b6..0c7406a8ca18 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.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index a52f32cccdb0..0f6d8dc91aef 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+22, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+24, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+45, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+40, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+49, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+70, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+64, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+40, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+64, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+23, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+25, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+48, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+52, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+75, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 8051b1b0ef18..5f2e5e7b15f3 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.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/bitwise, inst+20, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+14, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/bitwise, inst+14, unloaded +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/bitwise, inst+21, loaded [template = constants.%.8] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -72,18 +72,20 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .TestOp = %TestOp.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc23_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc23_11.1 -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -96,11 +98,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // 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: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -116,12 +120,12 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.%self.loc18_9.2: %C]() -> @impl.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C]() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 7a89225da365..1de953ce805a 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+72, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+95, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+90, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+99, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+120, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+114, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+90, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+114, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+77, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+79, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+102, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+106, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+129, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 283724486a64..3af7f07b51aa 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+122, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+124, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+145, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+140, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+149, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+170, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+164, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+140, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+164, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+131, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+133, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+156, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+160, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+183, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 5f0f8d4d8c61..ec7fc9279599 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+142, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+144, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+154, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+152, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+171, loaded [template = constants.%.10] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,13 +73,13 @@ fn TestOp() { // CHECK:STDOUT: .TestOp = %TestOp.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} +// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Dec { @@ -91,11 +91,13 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %self.patt: %.4 = binding_pattern self +// 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.%.4] -// CHECK:STDOUT: %self.loc18_14.1: %.4 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_14.3: %.4 = bind_name self, %self.loc18_14.1 -// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self.loc18_14.3 +// CHECK:STDOUT: %self.param: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.4 = bind_name self, %self.param +// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -111,7 +113,7 @@ fn TestOp() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.4](); +// CHECK:STDOUT: fn @Op.1[addr %self: %.4](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 8c85e011b820..1904157b53cb 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+212, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+214, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+235, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+230, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+239, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+260, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+254, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+230, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+254, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+227, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+229, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+252, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+256, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+279, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 15efa6f3678a..cc76befb2ace 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -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.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.10] +// 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.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+26, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -145,35 +145,41 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { -// CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc11_14.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestEqual.%a: %C = bind_name a, %a.loc11_14.1 -// CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc11_20.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestEqual.%b: %C = bind_name b, %b.loc11_20.1 -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_29.2: type = converted %bool.make_type.loc11, %.loc11_29.1 [template = bool] -// CHECK:STDOUT: @TestEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { -// CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc15_17.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestNotEqual.%a: %C = bind_name a, %a.loc15_17.1 -// CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc15_23.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestNotEqual.%b: %C = bind_name b, %b.loc15_23.1 -// CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] -// CHECK:STDOUT: %.loc15_32.2: type = converted %bool.make_type.loc15, %.loc15_32.1 [template = bool] -// CHECK:STDOUT: @TestNotEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,28 +193,34 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc7_12.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_12.2: %C = bind_name self, %self.loc7_12.1 +// 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.loc7_21.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc7_21.2: %C = bind_name other, %other.loc7_21.1 -// CHECK:STDOUT: %bool.make_type.loc7: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %bool.make_type.loc7 [template = bool] -// CHECK:STDOUT: %.loc7_34.2: type = converted %bool.make_type.loc7, %.loc7_34.1 [template = bool] -// CHECK:STDOUT: %return.var.loc7: ref bool = var +// 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: } // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc8_15.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc8_15.2: %C = bind_name self, %self.loc8_15.1 +// 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.loc8_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc8_24.2: %C = bind_name other, %other.loc8_24.1 -// CHECK:STDOUT: %bool.make_type.loc8: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8_37.1: type = value_of_initializer %bool.make_type.loc8 [template = bool] -// CHECK:STDOUT: %.loc8_37.2: type = converted %bool.make_type.loc8, %.loc8_37.1 [template = bool] -// CHECK:STDOUT: %return.var.loc8: ref bool = var +// 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: } // CHECK:STDOUT: %.loc6: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -227,9 +239,9 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[@impl.%self.loc7_12.2: %C](@impl.%other.loc7_21.2: %C) -> bool; +// CHECK:STDOUT: fn @Equal.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc8_15.2: %C](@impl.%other.loc8_24.2: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] @@ -327,12 +339,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.%.5] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+47, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.9] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -343,30 +355,36 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// 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: %D.ref.loc6_17: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc6_14.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestEqual.%a: %D = bind_name a, %a.loc6_14.1 -// CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc6_20.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestEqual.%b: %D = bind_name b, %b.loc6_20.1 -// CHECK:STDOUT: %bool.make_type.loc6: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %bool.make_type.loc6 [template = bool] -// CHECK:STDOUT: %.loc6_29.2: type = converted %bool.make_type.loc6, %.loc6_29.1 [template = bool] -// CHECK:STDOUT: @TestEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { -// CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc14_17.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestNotEqual.%a: %D = bind_name a, %a.loc14_17.1 -// CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc14_23.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestNotEqual.%b: %D = bind_name b, %b.loc14_23.1 -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_32.2: type = converted %bool.make_type.loc14, %.loc14_32.1 [template = bool] -// CHECK:STDOUT: @TestNotEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -487,19 +505,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.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.4: %.16 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.17] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.16 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.17] +// 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.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+26, unloaded -// CHECK:STDOUT: %import_ref.9: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+28, unloaded +// CHECK:STDOUT: %import_ref.9: %ImplicitAs.type = 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.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -511,36 +529,42 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: .TestLhsBad = %TestLhsBad.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%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: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { -// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc12_15.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestRhsBad.%a: %C = bind_name a, %a.loc12_15.1 -// CHECK:STDOUT: %D.ref.loc12: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc12_21.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestRhsBad.%b: %D = bind_name b, %b.loc12_21.1 -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_30.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_30.2: type = converted %bool.make_type.loc12, %.loc12_30.1 [template = bool] -// CHECK:STDOUT: @TestRhsBad.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestLhsBad.decl: %TestLhsBad.type = fn_decl @TestLhsBad [template = constants.%TestLhsBad] { -// CHECK:STDOUT: %D.ref.loc26: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc26_15.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestLhsBad.%a: %D = bind_name a, %a.loc26_15.1 -// CHECK:STDOUT: %C.ref.loc26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_21.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestLhsBad.%b: %C = bind_name b, %b.loc26_21.1 -// CHECK:STDOUT: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc26_30.1: type = value_of_initializer %bool.make_type.loc26 [template = bool] -// CHECK:STDOUT: %.loc26_30.2: type = converted %bool.make_type.loc26, %.loc26_30.1 [template = bool] -// CHECK:STDOUT: @TestLhsBad.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -573,28 +597,34 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc8_12.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc8_12.2: %C = bind_name self, %self.loc8_12.1 +// 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.loc8_21.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc8_21.2: %C = bind_name other, %other.loc8_21.1 -// CHECK:STDOUT: %bool.make_type.loc8: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8_34.1: type = value_of_initializer %bool.make_type.loc8 [template = bool] -// CHECK:STDOUT: %.loc8_34.2: type = converted %bool.make_type.loc8, %.loc8_34.1 [template = bool] -// CHECK:STDOUT: %return.var.loc8: ref bool = var +// 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: } // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc9_15.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc9_15.2: %C = bind_name self, %self.loc9_15.1 +// 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.loc9_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc9_24.2: %C = bind_name other, %other.loc9_24.1 -// CHECK:STDOUT: %bool.make_type.loc9: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc9_37.1: type = value_of_initializer %bool.make_type.loc9 [template = bool] -// CHECK:STDOUT: %.loc9_37.2: type = converted %bool.make_type.loc9, %.loc9_37.1 [template = bool] -// CHECK:STDOUT: %return.var.loc9: ref bool = var +// 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: } // CHECK:STDOUT: %.loc7: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -620,9 +650,9 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[@impl.%self.loc8_12.2: %C](@impl.%other.loc8_21.2: %C) -> bool; +// CHECK:STDOUT: fn @Equal.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc9_15.2: %C](@impl.%other.loc9_24.2: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal.2(constants.%Self.1: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] 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 57ab5cbe195e..4c37106009f5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -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+52, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.12 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.14 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.15] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+56, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded +// CHECK:STDOUT: %import_ref.3: %.12 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.13] +// 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.%.8] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded +// CHECK:STDOUT: %import_ref.7: %.14 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.15] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -108,29 +108,34 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: .TestAddAssignNonRef = %TestAddAssignNonRef.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc15: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc18: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.8] // CHECK:STDOUT: } // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc22_18.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestIncNonRef.%a: %C = bind_name a, %a.loc22_18.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %TestAddAssignNonRef.decl: %TestAddAssignNonRef.type = fn_decl @TestAddAssignNonRef [template = constants.%TestAddAssignNonRef] { -// CHECK:STDOUT: %C.ref.loc33_27: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc33_24.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestAddAssignNonRef.%a: %C = bind_name a, %a.loc33_24.1 -// CHECK:STDOUT: %C.ref.loc33_33: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc33_30.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAddAssignNonRef.%b: %C = bind_name b, %b.loc33_30.1 +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -150,11 +155,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %self.patt: %.4 = binding_pattern self +// 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.%.4] -// CHECK:STDOUT: %self.loc16_14.1: %.4 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_14.3: %.4 = bind_name self, %self.loc16_14.1 -// CHECK:STDOUT: %.loc16_9: %.4 = addr_pattern %self.loc16_14.3 +// CHECK:STDOUT: %self.param: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.4 = bind_name self, %self.param +// CHECK:STDOUT: %.loc16_9: %.4 = addr_pattern %self // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -165,14 +172,17 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.8 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.4 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.4] -// CHECK:STDOUT: %self.loc19_14.1: %.4 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_14.3: %.4 = bind_name self, %self.loc19_14.1 -// CHECK:STDOUT: %.loc19_9: %.4 = addr_pattern %self.loc19_14.3 +// CHECK:STDOUT: %self.param: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.4 = bind_name self, %self.param +// CHECK:STDOUT: %.loc19_9: %.4 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc19_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc19_24.2: %C = bind_name other, %other.loc19_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,7 +198,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.1.%self.loc16_14.3: %.4](); +// CHECK:STDOUT: fn @Op.1[addr %self: %.4](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] @@ -197,7 +207,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.6)](); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc19_14.3: %.4](@impl.2.%other.loc19_24.2: %C); +// CHECK:STDOUT: fn @Op.3[addr %self: %.4](%other: %C); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.8) { // CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 7f750ce4420a..773c05fcd79d 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+72, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%.5] +// 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 = 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.6: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8: %.9 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.13: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.15] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.18: %.17 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.18] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded +// CHECK:STDOUT: %import_ref.8: %.9 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.10] +// 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.%.11] +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded +// CHECK:STDOUT: %import_ref.13: %.13 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.14] +// 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.%.15] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded +// CHECK:STDOUT: %import_ref.18: %.17 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.18] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -130,28 +130,35 @@ fn TestRef(b: C) { // CHECK:STDOUT: .TestRef = %TestRef.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref.loc15_17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc15_14.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestUnary.%a: %C = bind_name a, %a.loc15_14.1 -// CHECK:STDOUT: %C.ref.loc15_23: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestUnary.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: %TestBinary.decl: %TestBinary.type = fn_decl @TestBinary [template = constants.%TestBinary] { -// CHECK:STDOUT: %C.ref.loc23_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc23_15.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestBinary.%a: %C = bind_name a, %a.loc23_15.1 -// CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc23_21.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestBinary.%b: %C = bind_name b, %b.loc23_21.1 -// CHECK:STDOUT: %C.ref.loc23_30: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestBinary.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestRef.decl: %TestRef.type = fn_decl @TestRef [template = constants.%TestRef] { -// CHECK:STDOUT: %C.ref.loc31: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc31_12.1: %C = param b, runtime_param0 -// CHECK:STDOUT: @TestRef.%b: %C = bind_name b, %b.loc31_12.1 +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -219,7 +226,7 @@ fn TestRef(b: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @TestRef(%b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a // CHECK:STDOUT: %a: ref %C = bind_name a, %a.var // CHECK:STDOUT: %.loc32_15.1: %.1 = struct_literal () 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 348bf6c3a33e..019065f32e40 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 @@ -116,20 +116,20 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.20 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.21] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.10: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.2 (%.14) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.19)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.12] +// 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.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded +// CHECK:STDOUT: %import_ref.7: %.20 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.21] +// 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 = 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.%.2 (%.14) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.19)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -141,32 +141,37 @@ fn TestAssign(b: D) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc16: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc16: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { -// CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc23_9.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @Test.%a: %C = bind_name a, %a.loc23_9.1 -// CHECK:STDOUT: %D.ref.loc23: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc23_15.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @Test.%b: %D = bind_name b, %b.loc23_15.1 -// CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @Test.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %D.ref.loc37: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc37_15.1: %D = param b, runtime_param0 -// CHECK:STDOUT: @TestAssign.%b: %D = bind_name b, %b.loc37_15.1 +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -205,14 +210,17 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc17_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc17_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17_9.2: %C = bind_name self, %self.loc17_9.1 +// 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.loc17_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc17_18.2: %C = bind_name other, %other.loc17_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -223,14 +231,17 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.6 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.7] -// CHECK:STDOUT: %self.loc20_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_14.3: %.7 = bind_name self, %self.loc20_14.1 -// CHECK:STDOUT: %.loc20_9: %.7 = addr_pattern %self.loc20_14.3 +// CHECK:STDOUT: %self.param: %.7 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.7 = bind_name self, %self.param +// CHECK:STDOUT: %.loc20_9: %.7 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc20_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc20_24.2: %C = bind_name other, %other.loc20_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = interface_witness (%Op.decl) [template = constants.%.9] // CHECK:STDOUT: @@ -253,7 +264,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc17_9.2: %C](@impl.1.%other.loc17_18.2: %C) -> %C; +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %C; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] @@ -261,7 +272,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc20_14.3: %.7](@impl.2.%other.loc20_24.2: %C); +// CHECK:STDOUT: fn @Op.3[addr %self: %.7](%other: %C); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { // CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index d70b719456e2..02d8ae9a6fa2 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -94,12 +94,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+52, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,44 +112,50 @@ fn Test() { // CHECK:STDOUT: .Test = %Test.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] -// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %ImplicitAs.ref.loc15: %ImplicitAs.type = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] -// CHECK:STDOUT: %X.ref.loc15: type = name_ref X, %X.decl [template = constants.%X] +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc15_28: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%.8] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %X.ref.loc19: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %ImplicitAs.ref.loc19: %ImplicitAs.type = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_26.2: type = converted %int.make_type_32.loc19, %.loc19_26.1 [template = i32] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc19_26.2: type = converted %int.make_type_32, %.loc19_26.1 [template = i32] // CHECK:STDOUT: %.loc19_26.3: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%.13] // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_16.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_16.2: type = converted %int.make_type_32.loc25, %.loc25_16.1 [template = i32] -// CHECK:STDOUT: %n.loc25_13.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Sink_i32.%n: i32 = bind_name n, %n.loc25_13.1 +// CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// 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: } // CHECK:STDOUT: %Sink_X.decl: %Sink_X.type = fn_decl @Sink_X [template = constants.%Sink_X] { -// CHECK:STDOUT: %X.ref.loc26: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %x.loc26_11.1: %X = param x, runtime_param0 -// CHECK:STDOUT: @Sink_X.%x: %X = bind_name x, %x.loc26_11.1 +// CHECK:STDOUT: %x.patt: %X = binding_pattern x +// 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: } // CHECK:STDOUT: %Source.decl: %Source.type = fn_decl @Source [template = constants.%Source] { -// CHECK:STDOUT: %T.loc27_11.1: type = param T, runtime_param -// CHECK:STDOUT: @Source.%T.loc27: type = bind_symbolic_name T 0, %T.loc27_11.1 [symbolic = @Source.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @Source.%T.loc27 [symbolic = @Source.%T.1 (constants.%T)] -// CHECK:STDOUT: @Source.%return: ref @Source.%T.1 (%T) = var +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc27: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc27 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %return: ref @Source.%T.1 (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} +// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -173,36 +179,40 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: i32 as %.8 { // 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: } { // 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.loc16_14.1: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_14.2: i32 = bind_name self, %self.loc16_14.1 +// 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.var: ref %X = var +// CHECK:STDOUT: %return: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.11] +// CHECK:STDOUT: %.loc15_32: = interface_witness (%Convert.decl) [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %.loc15 +// CHECK:STDOUT: witness = %.loc15_32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X as %.13 { // 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: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.loc20_14.1: %X = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_14.2: %X = bind_name self, %self.loc20_14.1 +// 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.var: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.16] +// CHECK:STDOUT: %.loc19_32: = interface_witness (%Convert.decl) [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %.loc19 +// CHECK:STDOUT: witness = %.loc19_32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -227,20 +237,20 @@ fn Test() { // CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[@impl.1.%self.loc16_14.2: i32]() -> @impl.1.%return.var: %X { +// CHECK:STDOUT: fn @Convert.2[%self: i32]() -> %return: %X { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: i32 = name_ref self, @impl.1.%self.loc16_14.2 +// CHECK:STDOUT: %self.ref: i32 = name_ref self, %self // CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) -// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access @impl.1.%return.var, element0 +// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc16_51.3: init i32 = initialize_from %self.ref to %.loc16_51.2 -// CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), @impl.1.%return.var +// CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), %return // CHECK:STDOUT: %.loc16_52: init %X = converted %.loc16_51.1, %.loc16_51.4 -// CHECK:STDOUT: return %.loc16_52 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[@impl.2.%self.loc20_14.2: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self: %X]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %X = name_ref self, @impl.2.%self.loc20_14.2 +// CHECK:STDOUT: %self.ref: %X = name_ref self, %self // CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] // CHECK:STDOUT: %.loc20_45.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc20_45.2: i32 = bind_value %.loc20_45.1 @@ -268,7 +278,7 @@ fn Test() { // CHECK:STDOUT: %.loc30_11.2: %.14 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.15] // CHECK:STDOUT: %Convert.ref.loc30: %.14 = name_ref Convert, %.loc30_11.2 [template = constants.%.15] // CHECK:STDOUT: %.loc30_18.2: ref %X = temporary %.loc30_18.1, %Source.call.loc30 -// CHECK:STDOUT: %.loc30_11.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19, element0 [template = constants.%Convert.4] +// CHECK:STDOUT: %.loc30_11.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19_32, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc30_11.4: = bound_method %.loc30_18.2, %.loc30_11.3 // CHECK:STDOUT: %.loc30_18.3: %X = bind_value %.loc30_18.2 // CHECK:STDOUT: %Convert.call.loc30: init i32 = call %.loc30_11.4(%.loc30_18.3) @@ -288,7 +298,7 @@ fn Test() { // CHECK:STDOUT: %Convert.ref.loc31: %.9 = name_ref Convert, %.loc31_9.2 [template = constants.%.10] // 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.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15, element0 [template = constants.%Convert.2] +// CHECK:STDOUT: %.loc31_9.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15_32, element0 [template = constants.%Convert.2] // CHECK:STDOUT: %.loc31_9.4: = bound_method %.loc31_16.4, %.loc31_9.3 // CHECK:STDOUT: %.loc31_9.5: ref %X = temporary_storage // CHECK:STDOUT: %.loc31_16.5: i32 = bind_value %.loc31_16.4 diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 0c8e9b17e8a5..e1006b427775 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+52, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+56, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.10] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,13 +73,13 @@ fn TestOp() { // CHECK:STDOUT: .TestOp = %TestOp.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} +// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { @@ -91,11 +91,13 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %self.patt: %.4 = binding_pattern self +// 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.%.4] -// CHECK:STDOUT: %self.loc18_14.1: %.4 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_14.3: %.4 = bind_name self, %self.loc18_14.1 -// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self.loc18_14.3 +// CHECK:STDOUT: %self.param: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.4 = bind_name self, %self.param +// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -111,7 +113,7 @@ fn TestOp() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.4](); +// CHECK:STDOUT: fn @Op.1[addr %self: %.4](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index e8b1f7d503b8..5c4499bd2714 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+172, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+174, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+195, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+190, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+199, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+214, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+190, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+185, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+187, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+210, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+237, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 4edf096b0371..a8bcefbeb4bd 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+262, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+264, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+285, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+280, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+289, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+310, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+304, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+280, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+304, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+281, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+283, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+306, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+310, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+333, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index d2b58af22e76..cda3437d0853 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+162, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+164, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+185, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+180, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+189, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+210, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+204, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+180, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+204, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+173, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+175, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+198, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+202, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+225, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index cf4f7acb3211..cd85f8db4e8b 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+72, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.8] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -72,18 +72,20 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .TestOp = %TestOp.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc23_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc23_11.1 -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -96,11 +98,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // 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: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -116,12 +120,12 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.%self.loc18_9.2: %C]() -> @impl.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C]() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 01a8b513d72b..5f607c080c1e 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+54, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+56, unloaded -// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.5: %.11 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref Core//prelude/operators/comparison, inst+72, loaded [template = constants.%Less.2] -// CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+93, loaded [template = constants.%LessOrEquivalent.2] -// CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref Core//prelude/operators/comparison, inst+114, loaded [template = constants.%Greater.2] -// CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+135, loaded [template = constants.%GreaterOrEquivalent.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+58, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+83, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+106, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.5: %.11 = import_ref Core//prelude/operators/comparison, inst+129, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Core//prelude/operators/comparison, inst+152, loaded [template = constants.%.14] +// 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.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+72, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+93, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+114, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+135, 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -161,59 +161,71 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { -// CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc13_13.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestLess.%a: %C = bind_name a, %a.loc13_13.1 -// CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc13_19.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestLess.%b: %C = bind_name b, %b.loc13_19.1 -// CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %bool.make_type.loc13 [template = bool] -// CHECK:STDOUT: %.loc13_28.2: type = converted %bool.make_type.loc13, %.loc13_28.1 [template = bool] -// CHECK:STDOUT: @TestLess.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { -// CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc17_18.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestLessEqual.%a: %C = bind_name a, %a.loc17_18.1 -// CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc17_24.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestLessEqual.%b: %C = bind_name b, %b.loc17_24.1 -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_33.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_33.2: type = converted %bool.make_type.loc17, %.loc17_33.1 [template = bool] -// CHECK:STDOUT: @TestLessEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { -// CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc21_16.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestGreater.%a: %C = bind_name a, %a.loc21_16.1 -// CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc21_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestGreater.%b: %C = bind_name b, %b.loc21_22.1 -// CHECK:STDOUT: %bool.make_type.loc21: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc21_31.1: type = value_of_initializer %bool.make_type.loc21 [template = bool] -// CHECK:STDOUT: %.loc21_31.2: type = converted %bool.make_type.loc21, %.loc21_31.1 [template = bool] -// CHECK:STDOUT: @TestGreater.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { -// CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc25_21.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestGreaterEqual.%a: %C = bind_name a, %a.loc25_21.1 -// CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc25_27.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestGreaterEqual.%b: %C = bind_name b, %b.loc25_27.1 -// CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc25_36.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] -// CHECK:STDOUT: %.loc25_36.2: type = converted %bool.make_type.loc25, %.loc25_36.1 [template = bool] -// CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,52 +241,64 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc7_11.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc7_11.2: %C = bind_name self, %self.loc7_11.1 +// 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.loc7_20.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc7_20.2: %C = bind_name other, %other.loc7_20.1 -// CHECK:STDOUT: %bool.make_type.loc7: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %bool.make_type.loc7 [template = bool] -// CHECK:STDOUT: %.loc7_33.2: type = converted %bool.make_type.loc7, %.loc7_33.1 [template = bool] -// CHECK:STDOUT: %return.var.loc7: ref bool = var +// 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: } // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc8_23.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc8_23.2: %C = bind_name self, %self.loc8_23.1 +// 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.loc8_32.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc8_32.2: %C = bind_name other, %other.loc8_32.1 -// CHECK:STDOUT: %bool.make_type.loc8: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8_45.1: type = value_of_initializer %bool.make_type.loc8 [template = bool] -// CHECK:STDOUT: %.loc8_45.2: type = converted %bool.make_type.loc8, %.loc8_45.1 [template = bool] -// CHECK:STDOUT: %return.var.loc8: ref bool = var +// 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: } // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc9_14.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc9_14.2: %C = bind_name self, %self.loc9_14.1 +// 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.loc9_23.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc9_23.2: %C = bind_name other, %other.loc9_23.1 -// CHECK:STDOUT: %bool.make_type.loc9: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type.loc9 [template = bool] -// CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type.loc9, %.loc9_36.1 [template = bool] -// CHECK:STDOUT: %return.var.loc9: ref bool = var +// 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: } // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc10_26.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc10_26.2: %C = bind_name self, %self.loc10_26.1 +// 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.loc10_35.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc10_35.2: %C = bind_name other, %other.loc10_35.1 -// CHECK:STDOUT: %bool.make_type.loc10: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc10_48.1: type = value_of_initializer %bool.make_type.loc10 [template = bool] -// CHECK:STDOUT: %.loc10_48.2: type = converted %bool.make_type.loc10, %.loc10_48.1 [template = bool] -// CHECK:STDOUT: %return.var.loc10: ref bool = var +// 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: } // CHECK:STDOUT: %.loc6: = interface_witness (%Less.decl, %LessOrEquivalent.decl, %Greater.decl, %GreaterOrEquivalent.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -295,13 +319,13 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less.1[@impl.%self.loc7_11.2: %C](@impl.%other.loc7_20.2: %C) -> bool; +// CHECK:STDOUT: fn @Less.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessOrEquivalent.1[@impl.%self.loc8_23.2: %C](@impl.%other.loc8_32.2: %C) -> bool; +// CHECK:STDOUT: fn @LessOrEquivalent.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater.1[@impl.%self.loc9_14.2: %C](@impl.%other.loc9_23.2: %C) -> bool; +// CHECK:STDOUT: fn @Greater.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterOrEquivalent.1[@impl.%self.loc10_26.2: %C](@impl.%other.loc10_35.2: %C) -> bool; +// CHECK:STDOUT: fn @GreaterOrEquivalent.1[%self: %C](%other: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Less.2(constants.%Self: %.3) { // CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] @@ -463,20 +487,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+54, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+56, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.6: %.10 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+72, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+93, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/comparison, inst+114, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+135, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+72, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+93, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+114, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+135, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+58, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+60, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+83, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+106, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.6: %.10 = import_ref Core//prelude/operators/comparison, inst+129, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/comparison, inst+152, loaded [template = constants.%.13] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -489,54 +513,66 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// 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: %D.ref.loc6_16: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc6_13.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestLess.%a: %D = bind_name a, %a.loc6_13.1 -// CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc6_19.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestLess.%b: %D = bind_name b, %b.loc6_19.1 -// CHECK:STDOUT: %bool.make_type.loc6: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc6_28.1: type = value_of_initializer %bool.make_type.loc6 [template = bool] -// CHECK:STDOUT: %.loc6_28.2: type = converted %bool.make_type.loc6, %.loc6_28.1 [template = bool] -// CHECK:STDOUT: @TestLess.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { -// CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc14_18.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestLessEqual.%a: %D = bind_name a, %a.loc14_18.1 -// CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc14_24.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestLessEqual.%b: %D = bind_name b, %b.loc14_24.1 -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_33.2: type = converted %bool.make_type.loc14, %.loc14_33.1 [template = bool] -// CHECK:STDOUT: @TestLessEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { -// CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc22_16.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestGreater.%a: %D = bind_name a, %a.loc22_16.1 -// CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc22_22.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestGreater.%b: %D = bind_name b, %b.loc22_22.1 -// CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc22_31.1: type = value_of_initializer %bool.make_type.loc22 [template = bool] -// CHECK:STDOUT: %.loc22_31.2: type = converted %bool.make_type.loc22, %.loc22_31.1 [template = bool] -// CHECK:STDOUT: @TestGreater.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { -// CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %a.loc30_21.1: %D = param a, runtime_param0 -// CHECK:STDOUT: @TestGreaterEqual.%a: %D = bind_name a, %a.loc30_21.1 -// CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %b.loc30_27.1: %D = param b, runtime_param1 -// CHECK:STDOUT: @TestGreaterEqual.%b: %D = bind_name b, %b.loc30_27.1 -// CHECK:STDOUT: %bool.make_type.loc30: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc30_36.1: type = value_of_initializer %bool.make_type.loc30 [template = bool] -// CHECK:STDOUT: %.loc30_36.2: type = converted %bool.make_type.loc30, %.loc30_36.1 [template = bool] -// CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var +// CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %b.patt: %D = binding_pattern b +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index 2ec2e5cf0713..f82d88a1709f 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+222, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+224, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+245, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+240, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+249, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+270, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+240, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+264, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+239, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+241, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+268, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+291, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 95d8cb31aa74..6a72018ad77d 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+92, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+94, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+115, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+110, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+119, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+140, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+134, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+110, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+134, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+98, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+100, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+123, loaded [template = constants.%.12] +// 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.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+127, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+150, loaded [template = constants.%.14] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +99,41 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .TestAssign = %TestAssign.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl.1 { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl.1 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.2 { -// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: impl_decl @impl.2 {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %a.loc26_11.1: %C = param a, runtime_param0 -// CHECK:STDOUT: @TestOp.%a: %C = bind_name a, %a.loc26_11.1 -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc26_17.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestOp.%b: %C = bind_name b, %b.loc26_17.1 -// CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @TestOp.%return: ref %C = var +// CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.patt: %.8 = binding_pattern a +// CHECK:STDOUT: %b.patt: %C = binding_pattern b +// 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.%.8] -// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 -// CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 +// CHECK:STDOUT: %a.param: %.8 = param a, runtime_param0 +// CHECK:STDOUT: %a: %.8 = 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,14 +153,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.3 { // 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: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_9.2: %C = bind_name self, %self.loc18_9.1 +// 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.loc18_18.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc18_18.2: %C = bind_name other, %other.loc18_18.1 +// 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.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: @@ -165,14 +174,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { +// CHECK:STDOUT: %self.patt: %.8 = binding_pattern self +// CHECK:STDOUT: %other.patt: %C = binding_pattern other +// 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.%.8] -// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %self.param: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self: %.8 = bind_name self, %self.param +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 -// CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 +// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: @@ -188,12 +200,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc18_9.2: %C](@impl.1.%other.loc18_18.2: %C) -> @impl.1.%return.var: %C { +// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), @impl.1.%return.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] // CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%struct] -// CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var +// CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { @@ -202,7 +214,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self: %.8](%other: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 9af6c13f5d3a..6933c3b5a2e3 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -46,7 +46,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 8ef0b469b2fd..9e777f39b83d 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -136,7 +136,7 @@ fn Main() { // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// 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"; @@ -206,12 +206,12 @@ fn Main() { // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 037c9a913138..33bcab182873 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -62,7 +62,7 @@ import library "var"; // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(); diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index eb4e8a16afe6..3b5bcb2a0a18 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -65,7 +65,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); @@ -153,7 +153,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B(); diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 9592da9c7180..eee187d8e69a 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -205,7 +205,7 @@ alias C = Other.C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -231,7 +231,7 @@ alias C = Other.C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C() { 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 fca2aea898cc..e01bf31ee0ba 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -218,7 +218,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -238,7 +238,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @F(); @@ -256,10 +256,12 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// 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.loc4_6.1: %.1 = param x, runtime_param0 -// CHECK:STDOUT: @F.%x: %.1 = bind_name x, %x.loc4_6.1 +// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -280,7 +282,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F2 = %F2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] {} +// CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F2() { @@ -308,7 +310,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -358,7 +360,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -402,7 +404,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -448,7 +450,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+6, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_fn_conflict, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -457,7 +459,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -493,7 +495,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -525,7 +527,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -556,7 +558,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Nested: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -584,7 +586,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -612,7 +614,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: .UseF = %UseF.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] {} +// CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UseF() { diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 3196ab2a3798..403ddcf66459 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -180,7 +180,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index a505ad129049..81b8ae1bcd7f 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -132,8 +132,8 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl // 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: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 2a09eafe7f2a..8ed381038f03 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -219,11 +219,11 @@ private export C; // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .NSC = %NSC.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %NSC.decl: type = class_decl @NSC [template = constants.%NSC] {} +// CHECK:STDOUT: %NSC.decl: type = class_decl @NSC [template = constants.%NSC] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -639,7 +639,7 @@ private export C; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Local = %Local.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Local.decl: type = class_decl @Local [template = constants.%Local] {} +// CHECK:STDOUT: %Local.decl: type = class_decl @Local [template = constants.%Local] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Local { diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index 5193b7a5b1ab..aa4361768fae 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -48,7 +48,7 @@ export C.n; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { 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 5a8e846834dc..399950d55f98 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 @@ -47,33 +47,37 @@ 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.loc4_10.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_10.2: type = bind_symbolic_name T 0, %T.loc4_10.1 [symbolic = @C1.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C2.decl: %C2.type = class_decl @C2 [template = constants.%C2.1] { -// CHECK:STDOUT: %T.loc5_10.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc5_10.2: type = bind_symbolic_name T 0, %T.loc5_10.1 [symbolic = @C2.%T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = param T, runtime_param +// CHECK:STDOUT: %T.loc5: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C1(file.%T.loc4_10.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C1(%T.loc4: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C2(file.%T.loc5_10.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: generic class @C2(%T.loc5: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C2(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_b.carbon @@ -90,8 +94,8 @@ export C2(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref Foo//a, inst+4, loaded [template = constants.%C1.1] -// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref Foo//a, inst+12, loaded [template = constants.%C2.1] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -101,8 +105,8 @@ 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.loc11_11.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_11.2: type = bind_symbolic_name T 0, %T.loc11_11.1 [symbolic = constants.%T] +// 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: %C2: %C2.type = export C2, imports.%import_ref.2 [template = constants.%C2.1] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index 17e9f65863a3..cdecf540391d 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -176,7 +176,7 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C1 = %C1.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} +// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { @@ -198,7 +198,7 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C2 = %C2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} +// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { @@ -223,7 +223,7 @@ import Other library "o1"; // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -245,7 +245,7 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .O1 = %O1.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %O1.decl: type = class_decl @O1 [template = constants.%O1] {} +// CHECK:STDOUT: %O1.decl: type = class_decl @O1 [template = constants.%O1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O1 { @@ -267,7 +267,7 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .O2 = %O2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %O2.decl: type = class_decl @O2 [template = constants.%O2] {} +// CHECK:STDOUT: %O2.decl: type = class_decl @O2 [template = constants.%O2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O2 { @@ -289,7 +289,7 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.decl: type = class_decl @Other [template = constants.%Other] {} +// CHECK:STDOUT: %Other.decl: type = class_decl @Other [template = constants.%Other] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Other { diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index 9d3368796bf7..b17d8f12615d 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -133,10 +133,10 @@ var n: {} = i32; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { // CHECK:STDOUT: %.loc4_16.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc4_16.2: type = converted %.loc4_16.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @Int32.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -200,10 +200,10 @@ var n: {} = i32; // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { // CHECK:STDOUT: %.loc8_16.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc8_16.2: type = converted %.loc8_16.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @Int32.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] @@ -244,10 +244,10 @@ var n: {} = i32; // CHECK:STDOUT: %Core: = namespace [template] { // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { // CHECK:STDOUT: %.loc7_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc7_21.2: type = converted %.loc7_21.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @Int32.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc9_9.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%.1 [template = constants.%.1] @@ -287,7 +287,7 @@ var n: {} = i32; // CHECK:STDOUT: .Core = %Core.decl // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.decl: type = class_decl @Core [template = constants.%Core] {} +// CHECK:STDOUT: %Core.decl: type = class_decl @Core [template = constants.%Core] {} {} // CHECK:STDOUT: %.loc12_9.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %n.var: ref %.1 = var n @@ -295,10 +295,10 @@ var n: {} = i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Core { -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} { // CHECK:STDOUT: %.loc6_18.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc6_18.2: type = converted %.loc6_18.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %return.var: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: = complete_type_witness %.1 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/unused_lazy_import.carbon b/toolchain/check/testdata/packages/unused_lazy_import.carbon index 8158b405727a..2c32f64e3f7c 100644 --- a/toolchain/check/testdata/packages/unused_lazy_import.carbon +++ b/toolchain/check/testdata/packages/unused_lazy_import.carbon @@ -45,7 +45,7 @@ impl package Implicit; // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 99f6cf01f48b..d734339f2501 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -46,11 +46,11 @@ fn F() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -58,9 +58,9 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] +// 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.var: ref i32 = var n // CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc12_16: i32 = int_literal 0 [template = constants.%.2] diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 7a0d7d0d7375..3c620a273d38 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -62,7 +62,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index 8488404272e7..365221109afb 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -59,20 +59,24 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%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: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.patt: %.2 = binding_pattern ptr +// 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.loc16_8.1: %.2 = param ptr, runtime_param0 -// CHECK:STDOUT: @Foo.%ptr: %.2 = bind_name ptr, %ptr.loc16_8.1 +// CHECK:STDOUT: %ptr.param: %.2 = param ptr, runtime_param0 +// CHECK:STDOUT: %ptr: %.2 = bind_name ptr, %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: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.loc12_13.1: %C = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13.2: %C = bind_name self, %self.loc12_13.1 +// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %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] @@ -85,7 +89,7 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: .field = %.loc13_12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Member[@C.%self.loc12_13.2: %C](); +// CHECK:STDOUT: fn @Member[%self: %C](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(%ptr: %.2) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index c3e69918762b..074d686dcb23 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -48,11 +48,11 @@ fn F() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index 308a8e6ce30f..d1bb8ef2eeba 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -51,7 +51,7 @@ fn Test() { // CHECK:STDOUT: .Test = %Test.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} +// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Test() { diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 3499669e27a3..889f208c4df6 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -171,30 +171,32 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: .AddressOfParam = %AddressOfParam.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// 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] +// 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: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_16.2: type = converted %int.make_type_32.loc13, %.loc13_16.1 [template = i32] +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_16.2: type = converted %int.make_type_32, %.loc13_16.1 [template = i32] // CHECK:STDOUT: %.loc13_19: type = struct_type {.a: i32} [template = constants.%.2] -// CHECK:STDOUT: @H.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [template = constants.%AddressOfLiteral] {} -// CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} -// CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [template = constants.%AddressOfCall] {} -// CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [template = constants.%AddressOfType] {} -// CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [template = constants.%AddressOfTupleElementValue] {} +// CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [template = constants.%AddressOfLiteral] {} {} +// CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} {} +// CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [template = constants.%AddressOfCall] {} {} +// CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [template = constants.%AddressOfType] {} {} +// 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: } { // 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.loc95_19.1: i32 = param param, runtime_param0 -// CHECK:STDOUT: @AddressOfParam.%param: i32 = bind_name param, %param.loc95_19.1 +// CHECK:STDOUT: %param.param: i32 = param param, runtime_param0 +// CHECK:STDOUT: %param: i32 = bind_name param, %param.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -285,9 +287,9 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfParam(%param: i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_32, %.loc99_22.1 [template = i32] +// 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] +// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_32.loc99, %.loc99_22.1 [template = 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 diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index c283e8a78a77..0f9e14d8d078 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -47,7 +47,7 @@ fn A() { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index bb3a98dea088..88453c1439b1 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -51,7 +51,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A: = namespace [template] {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 29fa90136f2e..a72d37be1239 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -75,11 +75,13 @@ fn Deref(n: i32) { // CHECK:STDOUT: } // 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: } { // 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.loc11_10.1: i32 = param n, runtime_param0 -// CHECK:STDOUT: @Deref.%n: i32 = bind_name n, %n.loc11_10.1 +// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index 958166e8218f..1aea39413bc9 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -59,12 +59,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] +// 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 { @@ -74,17 +74,19 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: } // 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: } { // 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.loc11_18.1: %.3 = param p, runtime_param0 -// CHECK:STDOUT: @ConstMismatch.%p: %.3 = bind_name p, %p.loc11_18.1 +// 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: @ConstMismatch.%return: ref %.5 = var +// CHECK:STDOUT: %return: ref %.5 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 8c3884a20d8a..15bdd986200f 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -50,6 +50,8 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: } // 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: } { // 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] // CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_32.loc12_29, %.loc12_23.1 [template = i32] @@ -58,13 +60,13 @@ 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.loc12_6.1: %.6 = param p, runtime_param0 -// CHECK:STDOUT: @F.%p: %.6 = bind_name p, %p.loc12_6.1 +// 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: @F.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index f74223cce039..831415ab1d71 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -54,32 +54,36 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: } // 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: } { // 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.loc11_8.1: %.2 = param p, runtime_param0 -// CHECK:STDOUT: @Ptr.%p: %.2 = bind_name p, %p.loc11_8.1 +// 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: @Ptr.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] { +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// 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.loc15_13.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @ConstPtr.%p: %.4 = bind_name p, %p.loc15_13.1 +// 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: @ConstPtr.%return: ref %.4 = var +// CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index 0f014aed654c..e8a1fd6d2825 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -45,7 +45,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 2507244dbfaf..6ba0276af1a4 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -61,15 +61,17 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // 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: } { // 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.loc11_6.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc11_6.1 +// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 2704612d8542..16391b99af91 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -51,15 +51,15 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: .Six = %Six.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %ReturnType.decl: %ReturnType.type = fn_decl @ReturnType [template = constants.%ReturnType] { -// CHECK:STDOUT: @ReturnType.%return: ref type = var +// CHECK:STDOUT: %ReturnType.decl: %ReturnType.type = fn_decl @ReturnType [template = constants.%ReturnType] {} { +// CHECK:STDOUT: %return: ref type = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { -// CHECK:STDOUT: %ReturnType.ref: %ReturnType.type = name_ref ReturnType, %ReturnType.decl [template = constants.%ReturnType] +// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] {} { +// CHECK:STDOUT: %ReturnType.ref: %ReturnType.type = name_ref ReturnType, file.%ReturnType.decl [template = constants.%ReturnType] // CHECK:STDOUT: %ReturnType.call: init type = call %ReturnType.ref() // CHECK:STDOUT: %.loc17_24.1: type = value_of_initializer %ReturnType.call // CHECK:STDOUT: %.loc17_24.2: type = converted %ReturnType.call, %.loc17_24.1 -// CHECK:STDOUT: @Six.%return: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,7 +75,7 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17: i32 = int_literal 6 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_35: i32 = int_literal 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index adcd5d96d5d5..656fe26a79ec 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -40,9 +40,9 @@ fn Six() -> x; // CHECK:STDOUT: .Six = %Six.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { +// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] {} { // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] -// CHECK:STDOUT: @Six.%return: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index dc2b88a31d74..64df337375de 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -45,11 +45,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon index 5a59f1374042..7a5be8200501 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -41,10 +41,10 @@ fn F() -> () { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %.loc11_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @F.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index 3569faa2fcea..68ca2238f36a 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -46,11 +46,11 @@ fn Procedure() -> i32 { // CHECK:STDOUT: .Procedure = %Procedure.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] { +// CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] {} { // 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: @Procedure.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index e2682b53389b..9a07a7f22a45 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -76,16 +76,16 @@ fn G() -> C { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// 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: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] +// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // 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] { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @G.%return: ref %C = var +// 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.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -110,9 +110,9 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32, %.loc12_19.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] +// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12, %.loc12_19.1 [template = i32] // CHECK:STDOUT: %v.var: ref i32 = var v // CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var // CHECK:STDOUT: %.loc12_25: i32 = int_literal 0 [template = constants.%.2] @@ -123,7 +123,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %return // CHECK:STDOUT: %.loc25_29: i32 = int_literal 1 [template = constants.%.3] // CHECK:STDOUT: %.loc25_37: i32 = int_literal 2 [template = constants.%.8] diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 143494d5becd..b77b0a969ac6 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -46,7 +46,7 @@ fn Procedure() { // CHECK:STDOUT: .Procedure = %Procedure.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] {} +// CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Procedure() { diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 7ae7efca35e6..39bf4b53e3cf 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -76,17 +76,17 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: .DifferentScopes = %DifferentScopes.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %SameScope.decl: %SameScope.type = fn_decl @SameScope [template = constants.%SameScope] { +// CHECK:STDOUT: %SameScope.decl: %SameScope.type = fn_decl @SameScope [template = constants.%SameScope] {} { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: @SameScope.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %DifferentScopes.decl: %DifferentScopes.type = fn_decl @DifferentScopes [template = constants.%DifferentScopes] { +// CHECK:STDOUT: %DifferentScopes.decl: %DifferentScopes.type = fn_decl @DifferentScopes [template = constants.%DifferentScopes] {} { // CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc26_25.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] // CHECK:STDOUT: %.loc26_25.2: type = converted %int.make_type_32.loc26, %.loc26_25.1 [template = i32] -// CHECK:STDOUT: @DifferentScopes.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index a60014671b7e..b876d3e47eb5 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -56,11 +56,11 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: .Mismatch = %Mismatch.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mismatch.decl: %Mismatch.type = fn_decl @Mismatch [template = constants.%Mismatch] { +// CHECK:STDOUT: %Mismatch.decl: %Mismatch.type = fn_decl @Mismatch [template = constants.%Mismatch] {} { // 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: @Mismatch.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 06e663adb6c2..174221b73b9e 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -59,12 +59,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,11 +73,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index b4c7f6ead00a..179d7b156e6a 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -46,7 +46,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index b2f6757928bf..637af1c28b69 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -49,11 +49,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index f59dfc1249be..10bff025a32d 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -49,10 +49,10 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var -// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { -// CHECK:STDOUT: %x.ref: ref type = name_ref x, %x -// CHECK:STDOUT: %.loc15: type = bind_value %x.ref -// CHECK:STDOUT: @Six.%return: ref = var +// CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] {} { +// CHECK:STDOUT: %x.ref: ref type = name_ref x, file.%x +// CHECK:STDOUT: %.loc15_13: type = bind_value %x.ref +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -60,7 +60,7 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15: i32 = int_literal 6 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_24: i32 = int_literal 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/missing_return_no_return_type.carbon b/toolchain/check/testdata/return/missing_return_no_return_type.carbon index 3ec091b6b297..08b4a8441ab6 100644 --- a/toolchain/check/testdata/return/missing_return_no_return_type.carbon +++ b/toolchain/check/testdata/return/missing_return_no_return_type.carbon @@ -38,7 +38,7 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/return/no_value.carbon b/toolchain/check/testdata/return/no_value.carbon index 99e2f448dd98..70d4292bd08c 100644 --- a/toolchain/check/testdata/return/no_value.carbon +++ b/toolchain/check/testdata/return/no_value.carbon @@ -39,7 +39,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 04d7b5e0e4b3..8ef64fafeba5 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -67,16 +67,16 @@ fn G() -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // 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: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: @F.%return: ref %C = var +// 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: %C.ref.loc16: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return: ref %C = var // 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] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: @G.%return: ref i32 = var +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { +// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] +// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32.loc21, %.loc21_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,7 +101,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %return: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %result: ref %C = bind_name result, %return // CHECK:STDOUT: %.loc17_34: i32 = int_literal 1 [template = constants.%.6] // CHECK:STDOUT: %.loc17_42: i32 = int_literal 2 [template = constants.%.7] @@ -118,9 +118,9 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_24.2: type = converted %int.make_type_32, %.loc22_24.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc22_24.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] +// CHECK:STDOUT: %.loc22_24.2: type = converted %int.make_type_32.loc22, %.loc22_24.1 [template = i32] // CHECK:STDOUT: %result.var: ref i32 = var result // CHECK:STDOUT: %result: ref i32 = bind_name result, %result.var // CHECK:STDOUT: %.loc22_30: i32 = int_literal 0 [template = constants.%.8] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 990cd43d7919..095da601b295 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -68,22 +68,24 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: .EnclosingButAfter = %EnclosingButAfter.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %UnrelatedScopes.decl: %UnrelatedScopes.type = fn_decl @UnrelatedScopes [template = constants.%UnrelatedScopes] { +// CHECK:STDOUT: %UnrelatedScopes.decl: %UnrelatedScopes.type = fn_decl @UnrelatedScopes [template = constants.%UnrelatedScopes] {} { // 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: @UnrelatedScopes.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %EnclosingButAfter.decl: %EnclosingButAfter.type = fn_decl @EnclosingButAfter [template = constants.%EnclosingButAfter] { +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// 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.loc21_22.1: bool = param b, runtime_param0 -// CHECK:STDOUT: @EnclosingButAfter.%b: bool = bind_name b, %b.loc21_22.1 +// 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: @EnclosingButAfter.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index a9a27c0d3683..0ba76d4cc649 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -46,12 +46,12 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // 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: %.loc11_22: type = struct_type {.a: i32} [template = constants.%.2] -// CHECK:STDOUT: @Main.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 2a65592029e3..120fc7a2b684 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -50,7 +50,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc12_20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_23.1: %.2 = tuple_literal (%int.make_type_32.loc12_15, %int.make_type_32.loc12_20) @@ -59,7 +59,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %.loc12_23.4: type = value_of_initializer %int.make_type_32.loc12_20 [template = i32] // CHECK:STDOUT: %.loc12_23.5: type = converted %int.make_type_32.loc12_20, %.loc12_23.4 [template = i32] // CHECK:STDOUT: %.loc12_23.6: type = converted %.loc12_23.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @Main.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 245b16507220..884033c2435d 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -44,11 +44,11 @@ fn Main() -> i32 { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: @Main.%return: ref i32 = var +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index f556ba804595..419732110490 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -41,7 +41,7 @@ fn F() { a.b; } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 5e452732684e..c4f7b5aeab4c 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -94,7 +94,7 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_16.1: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32] // CHECK:STDOUT: %.loc18_16.2: type = converted %int.make_type_32.loc18_16, %.loc18_16.1 [template = i32] @@ -110,7 +110,7 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %int.make_type_32.loc18_56: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_56.1: type = value_of_initializer %int.make_type_32.loc18_56 [template = i32] // CHECK:STDOUT: %.loc18_56.2: type = converted %int.make_type_32.loc18_56, %.loc18_56.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc27_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_13.1: type = value_of_initializer %int.make_type_32.loc27_13 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 93166472066a..6a817cdbf118 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index 5509bc5772e8..9063762315a3 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -42,7 +42,7 @@ fn A() { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index b7901b2298ec..278b34a7e7f7 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -55,12 +55,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 05658e10ef94..92e020a456ea 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -53,12 +53,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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 { diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 66c04410d654..2712fd0aa749 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -132,6 +132,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: } { // 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] // CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_32.loc8_18, %.loc8_18.1 [template = i32] @@ -139,28 +141,28 @@ 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.loc8_9.1: %.11 = param S, runtime_param -// CHECK:STDOUT: %S.loc8_9.2: %.11 = bind_symbolic_name S 0, %S.loc8_9.1 [symbolic = @C.%S (constants.%S)] +// CHECK:STDOUT: %S.param: %.11 = param S, runtime_param +// CHECK:STDOUT: %S.loc8: %.11 = bind_symbolic_name S 0, %S.param [symbolic = %S.1 (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, %C.decl [template = constants.%C.1] +// 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] // CHECK:STDOUT: %.loc9_19: i32 = int_literal 1 [template = constants.%.14] // CHECK:STDOUT: %.loc9_27: i32 = int_literal 2 [template = constants.%.15] // CHECK:STDOUT: %.loc9_28: %.11 = struct_literal (%.loc9_19, %.loc9_27) // CHECK:STDOUT: %struct: %.11 = struct_value (%.loc9_19, %.loc9_27) [template = constants.%struct.4] // CHECK:STDOUT: %.loc9_12: %.11 = converted %.loc9_28, %struct [template = constants.%struct.4] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.4) [template = constants.%C.3] -// CHECK:STDOUT: @F.%return: ref %C.3 = var +// CHECK:STDOUT: %return: ref %C.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%S.loc8_9.2: %.11) { -// CHECK:STDOUT: %S: %.11 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: generic class @C(%S.loc8: %.11) { +// CHECK:STDOUT: %S.1: %.11 = bind_symbolic_name S 0 [symbolic = %S.1 (constants.%S)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc8: = complete_type_witness %.12 [template = constants.%.13] +// CHECK:STDOUT: %.loc8_34: = complete_type_witness %.12 [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -202,11 +204,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { -// CHECK:STDOUT: %S => constants.%S +// CHECK:STDOUT: %S.1 => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct.4) { -// CHECK:STDOUT: %S => constants.%struct.4 +// CHECK:STDOUT: %S.1 => constants.%struct.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit.impl.carbon @@ -243,8 +245,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+99, 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+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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -257,7 +259,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+103, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+104, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -394,8 +396,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+99, 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+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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -406,7 +408,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+103, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+104, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -505,8 +507,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+99, 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+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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -518,13 +520,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+103, unloaded -// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+104, unloaded +// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = 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.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index 194cf83b8f36..d60681d2147e 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -55,7 +55,7 @@ fn F() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %int.make_type_32.loc11_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11_16 [template = i32] // CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32.loc11_16, %.loc11_16.1 [template = i32] @@ -66,13 +66,13 @@ fn F() -> 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: %.loc11_37: type = struct_type {.x: i32, .y: i32, .z: i32} [template = constants.%.2] -// CHECK:STDOUT: @G.%return: ref %.2 = var +// CHECK:STDOUT: %return: ref %.2 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: @F.%return: ref i32 = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 8b53700dfa9b..1bf69a59f538 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, 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: diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index abc350d407a5..0a80657e7e88 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -54,7 +54,7 @@ fn G() { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] @@ -66,9 +66,9 @@ fn G() { // CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] // CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index f29be33b989f..d31b0b8bfe8e 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -34,7 +34,7 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: .s = %s // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc19: type = struct_type {.a: %Incomplete} [template = constants.%.1] // CHECK:STDOUT: %s.var: ref = var s diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 04762e5d6ea0..bd422af85325 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+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -63,20 +63,20 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %MakeI32.decl: %MakeI32.type = fn_decl @MakeI32 [template = constants.%MakeI32] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: @MakeI32.%return: ref i32 = var +// CHECK:STDOUT: %MakeI32.decl: %MakeI32.type = fn_decl @MakeI32 [template = constants.%MakeI32] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32, %.loc11_17.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %MakeF64.decl: %MakeF64.type = fn_decl @MakeF64 [template = constants.%MakeF64] { +// CHECK:STDOUT: %MakeF64.decl: %MakeF64.type = fn_decl @MakeF64 [template = constants.%MakeF64] {} { // CHECK:STDOUT: %.loc12_17.1: i32 = int_literal 64 [template = constants.%.2] -// CHECK:STDOUT: %float.make_type.loc12: init type = call constants.%Float(%.loc12_17.1) [template = f64] -// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %float.make_type.loc12 [template = f64] -// CHECK:STDOUT: %.loc12_17.3: type = converted %float.make_type.loc12, %.loc12_17.2 [template = f64] -// CHECK:STDOUT: @MakeF64.%return: ref f64 = var +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_17.1) [template = f64] +// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc12_17.3: type = converted %float.make_type, %.loc12_17.2 [template = f64] +// CHECK:STDOUT: %return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_16.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_16.2: type = converted %int.make_type_32.loc14, %.loc14_16.1 [template = i32] @@ -85,7 +85,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %float.make_type.loc14 [template = f64] // CHECK:STDOUT: %.loc14_25.3: type = converted %float.make_type.loc14, %.loc14_25.2 [template = f64] // CHECK:STDOUT: %.loc14_28: type = struct_type {.a: i32, .b: f64} [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon index d0ab6c334c02..3086d1f9e436 100644 --- a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon @@ -48,8 +48,8 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 851737197e70..f56a1babb653 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+72, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.10] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { 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 aba988586d8a..f0a7d01dbc2b 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -62,12 +62,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index ab46330d5c6f..3ad6f61e0fe8 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -61,7 +61,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index 20e93502e0e1..5afbd68d1300 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -52,19 +52,19 @@ fn Run() -> i32 { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32.loc11) -// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32.loc11, %.loc11_16.2 [template = i32] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32) +// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32] // CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: @Run.%return: ref i32 = var +// 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] +// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] +// CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index d6aca4eaef00..ce06f9169d00 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -60,12 +60,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index fb2654b2b09a..21d7182529a2 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -56,7 +56,7 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} +// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc19_24.1: %.2 = tuple_literal (%int.make_type_32, %Incomplete.ref.loc19) diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index acb283d19ea5..2679940d98c2 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -56,12 +56,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index 166b0cf677f8..83f1728e6850 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -52,12 +52,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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 { diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 51f1872f3f26..b09f70484a1b 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -145,6 +145,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: } { // 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] // CHECK:STDOUT: %.loc7_22.1: %.6 = tuple_literal (%int.make_type_32.loc7_14, %int.make_type_32.loc7_19) @@ -153,28 +155,28 @@ 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.loc7_9.1: %.9 = param X, runtime_param -// CHECK:STDOUT: %X.loc7_9.2: %.9 = bind_symbolic_name X 0, %X.loc7_9.1 [symbolic = @C.%X (constants.%X)] +// CHECK:STDOUT: %X.param: %.9 = param X, runtime_param +// CHECK:STDOUT: %X.loc7: %.9 = bind_symbolic_name X 0, %X.param [symbolic = %X.1 (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, %C.decl [template = constants.%C.1] +// 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] // CHECK:STDOUT: %.loc9_14: i32 = int_literal 1 [template = constants.%.15] // CHECK:STDOUT: %.loc9_17: i32 = int_literal 2 [template = constants.%.16] // CHECK:STDOUT: %.loc9_18: %.9 = tuple_literal (%.loc9_14, %.loc9_17) // CHECK:STDOUT: %tuple: %.9 = tuple_value (%.loc9_14, %.loc9_17) [template = constants.%tuple.5] // CHECK:STDOUT: %.loc9_12: %.9 = converted %.loc9_18, %tuple [template = constants.%tuple.5] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.5) [template = constants.%C.3] -// CHECK:STDOUT: @F.%return: ref %C.3 = var +// CHECK:STDOUT: %return: ref %C.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(file.%X.loc7_9.2: %.9) { -// CHECK:STDOUT: %X: %.9 = bind_symbolic_name X 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: generic class @C(%X.loc7: %.9) { +// CHECK:STDOUT: %X.1: %.9 = bind_symbolic_name X 0 [symbolic = %X.1 (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc7: = complete_type_witness %.18 [template = constants.%.19] +// CHECK:STDOUT: %.loc7_26: = complete_type_witness %.18 [template = constants.%.19] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -223,11 +225,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { -// CHECK:STDOUT: %X => constants.%X +// CHECK:STDOUT: %X.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple.5) { -// CHECK:STDOUT: %X => constants.%tuple.5 +// CHECK:STDOUT: %X.1 => constants.%tuple.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit.impl.carbon @@ -266,8 +268,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+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -280,7 +282,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+107, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+108, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -434,8 +436,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+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -446,7 +448,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+107, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -546,8 +548,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+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// 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: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -559,13 +561,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+107, unloaded -// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded +// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = 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.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index f59ec488f32b..7f53e8c0ddf0 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -68,7 +68,7 @@ fn H() { // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] @@ -80,10 +80,10 @@ fn H() { // CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] // CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: @F.%return: ref %.3 = var +// CHECK:STDOUT: %return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 0a8370865d80..5bee9b2cec70 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -61,11 +61,13 @@ fn F(x: X) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%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.ref: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %x.loc14_6.1: %X = param x, runtime_param0 -// CHECK:STDOUT: @F.%x: %X = bind_name x, %x.loc14_6.1 +// CHECK:STDOUT: %x.patt: %X = binding_pattern x +// 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: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -82,7 +84,7 @@ fn F(x: X) { // CHECK:STDOUT: %s: ref String = bind_name s, %s.var // CHECK:STDOUT: %.loc21: String = string_literal "hello" [template = constants.%.6] // CHECK:STDOUT: assign %s.var, -// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %X.ref.loc27: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %y.var: ref %X = var y // CHECK:STDOUT: %y: ref %X = bind_name y, %y.var // CHECK:STDOUT: %x.ref: %X = name_ref x, %x diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index acedc18e4c9f..df0f7d5e3dca 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -55,12 +55,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -69,7 +69,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { diff --git a/toolchain/check/testdata/var/no_prelude/decl.carbon b/toolchain/check/testdata/var/no_prelude/decl.carbon index 515e85bee9af..546d552b2373 100644 --- a/toolchain/check/testdata/var/no_prelude/decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/decl.carbon @@ -24,7 +24,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon b/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon index 2c0a35cdd1d6..87ba8a6c6276 100644 --- a/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon +++ b/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon @@ -25,7 +25,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 8545ccddb0a9..1866917f1bae 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -33,7 +33,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon index df490538c51c..b0cff33a22fc 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon @@ -29,7 +29,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon index 5d707fea0212..fec3593118c9 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon @@ -29,7 +29,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon index cc3815ddec31..cca74aba81dc 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon @@ -27,7 +27,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon index fc0b8de67f68..7274e5dcc9d2 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon @@ -30,7 +30,7 @@ var y: () = x; // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: %.loc18_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc18_9.2: type = converted %.loc18_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %y.var: ref %.1 = var y diff --git a/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon index 8cb20cf885cb..421a3ec22641 100644 --- a/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon @@ -35,7 +35,7 @@ fn Main() { // CHECK:STDOUT: %.loc11_15: type = struct_type {.v: %.1} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/lookup.carbon b/toolchain/check/testdata/var/no_prelude/lookup.carbon index 6f30443b25cb..883c00547c4f 100644 --- a/toolchain/check/testdata/var/no_prelude/lookup.carbon +++ b/toolchain/check/testdata/var/no_prelude/lookup.carbon @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/var/no_prelude/shadowing.carbon b/toolchain/check/testdata/var/no_prelude/shadowing.carbon index 5a4c93f7a608..a771a46fe546 100644 --- a/toolchain/check/testdata/var/no_prelude/shadowing.carbon +++ b/toolchain/check/testdata/var/no_prelude/shadowing.carbon @@ -39,7 +39,7 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %NS: = namespace [template] {} -// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index 612ce86520d5..3ce5e1b4cee5 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -132,45 +132,53 @@ fn NotEmptyStruct() { // CHECK:STDOUT: .And = %And.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.1] {} -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.2] {} +// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.1] {} {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.2] {} {} // CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [template = constants.%Equal] { -// CHECK:STDOUT: %I.ref.loc11: type = name_ref I, %I.decl [template = constants.%.2] -// CHECK:STDOUT: %.Self.1: %.2 = bind_symbolic_name .Self 0 [symbolic = @Equal.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref.loc11: %.2 = name_ref .Self, %.Self.1 [symbolic = @Equal.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %Member.ref.loc11: %.3 = name_ref Member, @I.%.loc7 [template = constants.%.4] +// CHECK:STDOUT: %T.patt: %.2 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.2] +// CHECK:STDOUT: %.Self.1: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref: %.2 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %Member.ref: %.3 = name_ref Member, @I.%.loc7 [template = constants.%.4] // CHECK:STDOUT: %.loc11: %.8 = struct_literal () -// CHECK:STDOUT: %T.loc11_10.1: %.2 = param T, runtime_param -// CHECK:STDOUT: @Equal.%T.loc11: %.2 = bind_symbolic_name T 0, %T.loc11_10.1 [symbolic = @Equal.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.param: %.2 = param T, runtime_param +// CHECK:STDOUT: %T.loc11: %.2 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %EqualEqual.decl: %EqualEqual.type = fn_decl @EqualEqual [template = constants.%EqualEqual] { -// CHECK:STDOUT: %I.ref.loc13: type = name_ref I, %I.decl [template = constants.%.2] -// CHECK:STDOUT: %.Self.2: %.2 = bind_symbolic_name .Self 0 [symbolic = @EqualEqual.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref.loc13: %.2 = name_ref .Self, %.Self.2 [symbolic = @EqualEqual.%.Self (constants.%.Self.1)] +// CHECK:STDOUT: %U.patt: %.2 = symbolic_binding_pattern U 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.2] +// CHECK:STDOUT: %.Self.1: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref: %.2 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %.loc13: %.5 = tuple_literal () -// CHECK:STDOUT: %U.loc13_15.1: %.2 = param U, runtime_param -// CHECK:STDOUT: @EqualEqual.%U.loc13: %.2 = bind_symbolic_name U 0, %U.loc13_15.1 [symbolic = @EqualEqual.%U.1 (constants.%U)] +// CHECK:STDOUT: %U.param: %.2 = param U, runtime_param +// CHECK:STDOUT: %U.loc13: %.2 = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %Impls.decl: %Impls.type = fn_decl @Impls [template = constants.%Impls] { -// CHECK:STDOUT: %J.ref: type = name_ref J, %J.decl [template = constants.%.1] -// CHECK:STDOUT: %.Self.3: %.1 = bind_symbolic_name .Self 0 [symbolic = @Impls.%.Self (constants.%.Self.2)] -// CHECK:STDOUT: %.Self.ref.loc15: %.1 = name_ref .Self, %.Self.3 [symbolic = @Impls.%.Self (constants.%.Self.2)] -// CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.2] -// CHECK:STDOUT: %V.loc15_10.1: %.1 = param V, runtime_param -// CHECK:STDOUT: @Impls.%V.loc15: %.1 = bind_symbolic_name V 0, %V.loc15_10.1 [symbolic = @Impls.%V.1 (constants.%V)] +// CHECK:STDOUT: %V.patt: %.1 = symbolic_binding_pattern V 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.1] +// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.2)] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.2] +// CHECK:STDOUT: %V.param: %.1 = param V, runtime_param +// CHECK:STDOUT: %V.loc15: %.1 = bind_symbolic_name V 0, %V.param [symbolic = %V.1 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %I.ref.loc17_12: type = name_ref I, %I.decl [template = constants.%.2] -// CHECK:STDOUT: %.Self.4: %.2 = bind_symbolic_name .Self 0 [symbolic = @And.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref.loc17_20: %.2 = name_ref .Self, %.Self.4 [symbolic = @And.%.Self (constants.%.Self.1)] +// CHECK:STDOUT: %W.patt: %.2 = symbolic_binding_pattern W 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref.loc17_12: type = name_ref I, file.%I.decl [template = constants.%.2] +// CHECK:STDOUT: %.Self.1: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref.loc17_20: %.2 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %Second.ref.loc17_20: %.6 = name_ref Second, @I.%.loc8 [template = constants.%.7] -// CHECK:STDOUT: %I.ref.loc17_34: type = name_ref I, %I.decl [template = constants.%.2] -// CHECK:STDOUT: %.Self.ref.loc17_40: %.2 = name_ref .Self, %.Self.4 [symbolic = @And.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %Member.ref.loc17: %.3 = name_ref Member, @I.%.loc7 [template = constants.%.4] -// CHECK:STDOUT: %.Self.ref.loc17_50: %.2 = name_ref .Self, %.Self.4 [symbolic = @And.%.Self (constants.%.Self.1)] +// CHECK:STDOUT: %I.ref.loc17_34: type = name_ref I, file.%I.decl [template = constants.%.2] +// CHECK:STDOUT: %.Self.ref.loc17_40: %.2 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %Member.ref: %.3 = name_ref Member, @I.%.loc7 [template = constants.%.4] +// CHECK:STDOUT: %.Self.ref.loc17_50: %.2 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %Second.ref.loc17_50: %.6 = name_ref Second, @I.%.loc8 [template = constants.%.7] -// CHECK:STDOUT: %W.loc17_8.1: %.2 = param W, runtime_param -// CHECK:STDOUT: @And.%W.loc17: %.2 = bind_symbolic_name W 0, %W.loc17_8.1 [symbolic = @And.%W.1 (constants.%W)] +// CHECK:STDOUT: %W.param: %.2 = param W, runtime_param +// CHECK:STDOUT: %W.loc17: %.2 = bind_symbolic_name W 0, %W.param [symbolic = %W.1 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -198,50 +206,50 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal(%T.loc11: %.2) { -// CHECK:STDOUT: %.Self: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.2: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %T.1: %.2 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.loc11: %.2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @EqualEqual(%U.loc13: %.2) { -// CHECK:STDOUT: %.Self: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.2: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %U.1: %.2 = bind_symbolic_name U 0 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.loc13: %.2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Impls(%V.loc15: %.1) { -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] // CHECK:STDOUT: %V.1: %.1 = bind_symbolic_name V 0 [symbolic = %V.1 (constants.%V)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%V.loc15: %.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @And(%W.loc17: %.2) { -// CHECK:STDOUT: %.Self: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.2: %.2 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %W.1: %.2 = bind_symbolic_name W 0 [symbolic = %W.1 (constants.%W)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%W.loc17: %.2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Equal(constants.%T) { -// CHECK:STDOUT: %.Self => constants.%T +// CHECK:STDOUT: %.Self.2 => constants.%T // CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @EqualEqual(constants.%U) { -// CHECK:STDOUT: %.Self => constants.%U +// CHECK:STDOUT: %.Self.2 => constants.%U // CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Impls(constants.%V) { -// CHECK:STDOUT: %.Self => constants.%V +// CHECK:STDOUT: %.Self.2 => constants.%V // CHECK:STDOUT: %V.1 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @And(constants.%W) { -// CHECK:STDOUT: %.Self => constants.%W +// CHECK:STDOUT: %.Self.2 => constants.%W // CHECK:STDOUT: %W.1 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: @@ -263,10 +271,10 @@ 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.%.1] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+31, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+43, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+73, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+45, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+59, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+77, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -299,13 +307,15 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %TypeMismatch.decl: %TypeMismatch.type = fn_decl @TypeMismatch [template = constants.%TypeMismatch] { +// CHECK:STDOUT: %X.patt: %.1 = symbolic_binding_pattern X 0 +// CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%.1] -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = @TypeMismatch.%.Self (constants.%.Self)] -// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self [symbolic = @TypeMismatch.%.Self (constants.%.Self)] +// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self)] +// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self)] // CHECK:STDOUT: %Member.ref: %.3 = name_ref Member, imports.%import_ref.8 [template = constants.%.4] // CHECK:STDOUT: %.loc8: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %X.loc8_17.1: %.1 = param X, runtime_param -// CHECK:STDOUT: @TypeMismatch.%X.loc8: %.1 = bind_symbolic_name X 0, %X.loc8_17.1 [symbolic = @TypeMismatch.%X.1 (constants.%X)] +// CHECK:STDOUT: %X.param: %.1 = param X, runtime_param +// CHECK:STDOUT: %X.loc8: %.1 = bind_symbolic_name X 0, %X.param [symbolic = %X.1 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -318,14 +328,14 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TypeMismatch(%X.loc8: %.1) { -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self)] +// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self)] // CHECK:STDOUT: %X.1: %.1 = bind_symbolic_name X 0 [symbolic = %X.1 (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%X.loc8: %.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TypeMismatch(constants.%X) { -// CHECK:STDOUT: %.Self => constants.%X +// CHECK:STDOUT: %.Self.2 => constants.%X // CHECK:STDOUT: %X.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,10 +382,10 @@ fn NotEmptyStruct() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//state_constraints, inst+3, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Main//state_constraints, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+31, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+43, unloaded -// CHECK:STDOUT: %import_ref.5: %Impls.type = import_ref Main//state_constraints, inst+56, loaded [template = constants.%Impls] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+73, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+45, unloaded +// CHECK:STDOUT: %import_ref.5: %Impls.type = import_ref Main//state_constraints, inst+59, loaded [template = constants.%Impls] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+77, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude @@ -388,12 +398,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.7 = import_ref Main//state_constraints, inst+5, unloaded -// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type = 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.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] +// 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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -412,21 +422,23 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: impl_decl @impl { -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %J.ref.loc8: type = name_ref J, imports.%import_ref.1 [template = constants.%.3] +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: impl_decl @impl {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %DoesNotImplI.decl: %DoesNotImplI.type = fn_decl @DoesNotImplI [template = constants.%DoesNotImplI] {} +// 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: %J.ref.loc26: type = name_ref J, imports.%import_ref.1 [template = constants.%.3] -// CHECK:STDOUT: %.Self: %.3 = bind_symbolic_name .Self 0 [symbolic = @EmptyStruct.%.Self (constants.%.Self.2)] -// CHECK:STDOUT: %.Self.ref: %.3 = name_ref .Self, %.Self [symbolic = @EmptyStruct.%.Self (constants.%.Self.2)] +// CHECK:STDOUT: %Y.patt: %.3 = symbolic_binding_pattern Y 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%.3] +// CHECK:STDOUT: %.Self.1: %.3 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.ref: %.3 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.2)] // CHECK:STDOUT: %.loc26: %.1 = struct_literal () -// CHECK:STDOUT: %Y.loc26_16.1: %.3 = param Y, runtime_param -// CHECK:STDOUT: @EmptyStruct.%Y.loc26: %.3 = bind_symbolic_name Y 0, %Y.loc26_16.1 [symbolic = @EmptyStruct.%Y.1 (constants.%Y)] +// CHECK:STDOUT: %Y.param: %.3 = param Y, runtime_param +// CHECK:STDOUT: %Y.loc26: %.3 = bind_symbolic_name Y 0, %Y.param [symbolic = %Y.1 (constants.%Y)] // CHECK:STDOUT: } -// CHECK:STDOUT: %NotEmptyStruct.decl: %NotEmptyStruct.type = fn_decl @NotEmptyStruct [template = constants.%NotEmptyStruct] {} +// CHECK:STDOUT: %NotEmptyStruct.decl: %NotEmptyStruct.type = fn_decl @NotEmptyStruct [template = constants.%NotEmptyStruct] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J { @@ -495,7 +507,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @EmptyStruct(%Y.loc26: %.3) { -// CHECK:STDOUT: %.Self: %.3 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.2: %.3 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] // CHECK:STDOUT: %Y.1: %.3 = bind_symbolic_name Y 0 [symbolic = %Y.1 (constants.%Y)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%Y.loc26: %.3); @@ -548,7 +560,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @EmptyStruct(constants.%Y) { -// CHECK:STDOUT: %.Self => constants.%Y +// CHECK:STDOUT: %.Self.2 => constants.%Y // CHECK:STDOUT: %Y.1 => constants.%Y // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/no_prelude/designator.carbon b/toolchain/check/testdata/where_expr/no_prelude/designator.carbon index 622180099333..cfb7ff8d7e8f 100644 --- a/toolchain/check/testdata/where_expr/no_prelude/designator.carbon +++ b/toolchain/check/testdata/where_expr/no_prelude/designator.carbon @@ -115,30 +115,36 @@ class D { // CHECK:STDOUT: .PeriodMember = %PeriodMember.decl // CHECK:STDOUT: .TypeSelfImpls = %TypeSelfImpls.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {} // CHECK:STDOUT: %PeriodSelf.decl: %PeriodSelf.type = fn_decl @PeriodSelf [template = constants.%PeriodSelf] { -// CHECK:STDOUT: %I.ref.loc8: type = name_ref I, %I.decl [template = constants.%.1] -// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = @PeriodSelf.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref.loc8: %.1 = name_ref .Self, %.Self.1 [symbolic = @PeriodSelf.%.Self (constants.%.Self.1)] +// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] +// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %.loc8: %.4 = tuple_literal () -// CHECK:STDOUT: %T.loc8_15.1: %.1 = param T, runtime_param -// CHECK:STDOUT: @PeriodSelf.%T.loc8: %.1 = bind_symbolic_name T 0, %T.loc8_15.1 [symbolic = @PeriodSelf.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param +// CHECK:STDOUT: %T.loc8: %.1 = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %PeriodMember.decl: %PeriodMember.type = fn_decl @PeriodMember [template = constants.%PeriodMember] { -// CHECK:STDOUT: %I.ref.loc10: type = name_ref I, %I.decl [template = constants.%.1] -// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = @PeriodMember.%.Self (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref.loc10: %.1 = name_ref .Self, %.Self.2 [symbolic = @PeriodMember.%.Self (constants.%.Self.1)] +// CHECK:STDOUT: %U.patt: %.1 = symbolic_binding_pattern U 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] +// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %Member.ref: %.2 = name_ref Member, @I.%.loc5 [template = constants.%.3] // CHECK:STDOUT: %.loc10: %.5 = struct_literal () -// CHECK:STDOUT: %U.loc10_17.1: %.1 = param U, runtime_param -// CHECK:STDOUT: @PeriodMember.%U.loc10: %.1 = bind_symbolic_name U 0, %U.loc10_17.1 [symbolic = @PeriodMember.%U.1 (constants.%U)] +// CHECK:STDOUT: %U.param: %.1 = param U, runtime_param +// CHECK:STDOUT: %U.loc10: %.1 = bind_symbolic_name U 0, %U.param [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %TypeSelfImpls.decl: %TypeSelfImpls.type = fn_decl @TypeSelfImpls [template = constants.%TypeSelfImpls] { -// CHECK:STDOUT: %.Self.3: type = bind_symbolic_name .Self 0 [symbolic = @TypeSelfImpls.%.Self (constants.%.Self.2)] -// CHECK:STDOUT: %.Self.ref.loc12: type = name_ref .Self, %.Self.3 [symbolic = @TypeSelfImpls.%.Self (constants.%.Self.2)] -// CHECK:STDOUT: %I.ref.loc12: type = name_ref I, %I.decl [template = constants.%.1] -// CHECK:STDOUT: %V.loc12_18.1: type = param V, runtime_param -// CHECK:STDOUT: @TypeSelfImpls.%V.loc12: type = bind_symbolic_name V 0, %V.loc12_18.1 [symbolic = @TypeSelfImpls.%V.1 (constants.%V)] +// CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.Self.1: type = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.2)] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] +// CHECK:STDOUT: %V.param: type = param V, runtime_param +// CHECK:STDOUT: %V.loc12: type = bind_symbolic_name V 0, %V.param [symbolic = %V.1 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,38 +160,38 @@ class D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodSelf(%T.loc8: %.1) { -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %T.1: %.1 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.loc8: %.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodMember(%U.loc10: %.1) { -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.1)] // CHECK:STDOUT: %U.1: %.1 = bind_symbolic_name U 0 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.loc10: %.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc12: type) { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self.2)] +// CHECK:STDOUT: %.Self.2: type = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self.2)] // CHECK:STDOUT: %V.1: type = bind_symbolic_name V 0 [symbolic = %V.1 (constants.%V)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%V.loc12: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodSelf(constants.%T) { -// CHECK:STDOUT: %.Self => constants.%T +// CHECK:STDOUT: %.Self.2 => constants.%T // CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodMember(constants.%U) { -// CHECK:STDOUT: %.Self => constants.%U +// CHECK:STDOUT: %.Self.2 => constants.%U // CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TypeSelfImpls(constants.%V) { -// CHECK:STDOUT: %.Self => constants.%V +// CHECK:STDOUT: %.Self.2 => constants.%V // CHECK:STDOUT: %V.1 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: @@ -209,15 +215,17 @@ class D { // CHECK:STDOUT: .J = %J.decl // CHECK:STDOUT: .PeriodMismatch = %PeriodMismatch.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.1] {} +// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.1] {} {} // CHECK:STDOUT: %PeriodMismatch.decl: %PeriodMismatch.type = fn_decl @PeriodMismatch [template = constants.%PeriodMismatch] { -// CHECK:STDOUT: %J.ref: type = name_ref J, %J.decl [template = constants.%.1] -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = @PeriodMismatch.%.Self (constants.%.Self)] -// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self [symbolic = @PeriodMismatch.%.Self (constants.%.Self)] +// CHECK:STDOUT: %W.patt: %.1 = symbolic_binding_pattern W 0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.1] +// CHECK:STDOUT: %.Self.1: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self)] +// CHECK:STDOUT: %.Self.ref: %.1 = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self)] // CHECK:STDOUT: %Mismatch.ref: = name_ref Mismatch, [template = ] // CHECK:STDOUT: %.loc12: %.5 = struct_literal () -// CHECK:STDOUT: %W.loc12_19.1: %.1 = param W, runtime_param -// CHECK:STDOUT: @PeriodMismatch.%W.loc12: %.1 = bind_symbolic_name W 0, %W.loc12_19.1 [symbolic = @PeriodMismatch.%W.1 (constants.%W)] +// CHECK:STDOUT: %W.param: %.1 = param W, runtime_param +// CHECK:STDOUT: %W.loc12: %.1 = bind_symbolic_name W 0, %W.param [symbolic = %W.1 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -233,14 +241,14 @@ class D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodMismatch(%W.loc12: %.1) { -// CHECK:STDOUT: %.Self: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self (constants.%.Self)] +// CHECK:STDOUT: %.Self.2: %.1 = bind_symbolic_name .Self 0 [symbolic = %.Self.2 (constants.%.Self)] // CHECK:STDOUT: %W.1: %.1 = bind_symbolic_name W 0 [symbolic = %W.1 (constants.%W)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%W.loc12: %.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodMismatch(constants.%W) { -// CHECK:STDOUT: %.Self => constants.%W +// CHECK:STDOUT: %.Self.2 => constants.%W // CHECK:STDOUT: %W.1 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: @@ -256,10 +264,10 @@ class D { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { +// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} { // CHECK:STDOUT: %.loc4_14.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_14.2: type = converted %.loc4_14.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @Foo.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -285,10 +293,10 @@ class D { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { +// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} { // CHECK:STDOUT: %.loc4_14.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_14.2: type = converted %.loc4_14.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: @Bar.%return: ref %.1 = var +// CHECK:STDOUT: %return: ref %.1 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -314,13 +322,13 @@ class D { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %return.var: ref %C = var +// CHECK:STDOUT: %return: ref %C = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -329,10 +337,10 @@ class D { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> @C.%return.var: %C { +// CHECK:STDOUT: fn @F() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.Self.ref: = name_ref .Self, [template = ] -// CHECK:STDOUT: return to @C.%return.var +// CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_dot_self_method_return_type.carbon @@ -350,13 +358,13 @@ class D { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %.Self.ref: = name_ref .Self, [template = ] -// CHECK:STDOUT: %return.var: ref = var +// CHECK:STDOUT: %return: ref = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc9: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/break_continue.carbon b/toolchain/check/testdata/while/break_continue.carbon index bcdbf37a95cb..2a58a9bab12d 100644 --- a/toolchain/check/testdata/while/break_continue.carbon +++ b/toolchain/check/testdata/while/break_continue.carbon @@ -85,55 +85,55 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: @A.%return: ref bool = var +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} { +// 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: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] -// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] -// CHECK:STDOUT: @B.%return: ref bool = var +// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type, %.loc12_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { -// CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %bool.make_type.loc13 [template = bool] -// CHECK:STDOUT: %.loc13_11.2: type = converted %bool.make_type.loc13, %.loc13_11.1 [template = bool] -// CHECK:STDOUT: @C.%return: ref bool = var +// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc13_11.2: type = converted %bool.make_type, %.loc13_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] { -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_11.2: type = converted %bool.make_type.loc14, %.loc14_11.1 [template = bool] -// CHECK:STDOUT: @D.%return: ref bool = var +// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc14_11.2: type = converted %bool.make_type, %.loc14_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] { -// CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] -// CHECK:STDOUT: %.loc15_11.2: type = converted %bool.make_type.loc15, %.loc15_11.1 [template = bool] -// CHECK:STDOUT: @E.%return: ref bool = var +// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc15_11.2: type = converted %bool.make_type, %.loc15_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_11.2: type = converted %bool.make_type.loc16, %.loc16_11.1 [template = bool] -// CHECK:STDOUT: @F.%return: ref bool = var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_11.2: type = converted %bool.make_type, %.loc16_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_11.2: type = converted %bool.make_type.loc17, %.loc17_11.1 [template = bool] -// CHECK:STDOUT: @G.%return: ref bool = var +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc17_11.2: type = converted %bool.make_type, %.loc17_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] -// CHECK:STDOUT: %.loc18_11.2: type = converted %bool.make_type.loc18, %.loc18_11.1 [template = bool] -// CHECK:STDOUT: @H.%return: ref bool = var +// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc18_11.2: type = converted %bool.make_type, %.loc18_11.1 [template = bool] +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} +// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index b3bd6119f7ec..d3d416223357 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -56,12 +56,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 = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = 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.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (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 { @@ -70,7 +70,7 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} +// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index ca784a4c2838..a2f01b1d2d05 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -62,7 +62,7 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} +// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @While() { diff --git a/toolchain/check/testdata/while/unreachable_end.carbon b/toolchain/check/testdata/while/unreachable_end.carbon index 696339a91393..bd8634ff4ebc 100644 --- a/toolchain/check/testdata/while/unreachable_end.carbon +++ b/toolchain/check/testdata/while/unreachable_end.carbon @@ -66,16 +66,16 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { +// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] {} { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_14.2: type = converted %bool.make_type, %.loc11_14.1 [template = bool] -// CHECK:STDOUT: @Cond.%return: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// 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: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} -// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} +// 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: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} +// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index d1390d7aefc7..2da49748f24f 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -65,16 +65,16 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { +// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] {} { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_14.2: type = converted %bool.make_type, %.loc11_14.1 [template = bool] -// CHECK:STDOUT: @Cond.%return: ref bool = var +// CHECK:STDOUT: %return: ref bool = var // CHECK:STDOUT: } -// 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: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} -// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} +// 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: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} +// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/sem_ir/entity_with_params_base.h b/toolchain/sem_ir/entity_with_params_base.h index ba0ebf72a22a..e2f17cae9199 100644 --- a/toolchain/sem_ir/entity_with_params_base.h +++ b/toolchain/sem_ir/entity_with_params_base.h @@ -44,6 +44,7 @@ struct EntityWithParamsBase { auto MergeDefinition(const EntityWithParamsBase& definition) -> void { first_param_node_id = definition.first_param_node_id; 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; param_refs_id = definition.param_refs_id; definition_id = definition.definition_id; @@ -88,6 +89,8 @@ struct EntityWithParamsBase { // definition. Parse::NodeId first_param_node_id; 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. InstBlockId implicit_param_refs_id; // A block containing a single reference instruction per parameter. diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index e9a0bcdb3719..3f8bbbe52e39 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -421,6 +421,7 @@ static auto StringifyTypeExprImpl(const SemIR::File& outer_sem_ir, case AssociatedConstantDecl::Kind: case AssociatedEntity::Kind: case BaseDecl::Kind: + case BindingPattern::Kind: case BindName::Kind: case BindValue::Kind: case BlockArg::Kind: @@ -460,6 +461,7 @@ static auto StringifyTypeExprImpl(const SemIR::File& outer_sem_ir, case StructLiteral::Kind: case StructInit::Kind: case StructValue::Kind: + case SymbolicBindingPattern::Kind: case Temporary::Kind: case TemporaryStorage::Kind: case TupleAccess::Kind: @@ -507,6 +509,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case AdaptDecl::Kind: case Assign::Kind: case BaseDecl::Kind: + case BindingPattern::Kind: case Branch::Kind: case BranchIf::Kind: case BranchWithArg::Kind: @@ -517,6 +520,7 @@ 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: diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 9c35e139d48f..e84daf6eb8d0 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -797,21 +797,35 @@ class FormatterImpl { auto FormatInstRHS(FunctionDecl inst) -> void { FormatArgs(inst.function_id); + llvm::SaveAndRestore class_scope( + scope_, inst_namer_->GetScopeFor(inst.function_id)); + FormatTrailingBlock( + sem_ir_.functions().Get(inst.function_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } auto FormatInstRHS(ClassDecl inst) -> void { FormatArgs(inst.class_id); + llvm::SaveAndRestore class_scope(scope_, + inst_namer_->GetScopeFor(inst.class_id)); + FormatTrailingBlock(sem_ir_.classes().Get(inst.class_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } auto FormatInstRHS(ImplDecl inst) -> void { FormatArgs(inst.impl_id); + llvm::SaveAndRestore class_scope(scope_, + inst_namer_->GetScopeFor(inst.impl_id)); + FormatTrailingBlock(sem_ir_.impls().Get(inst.impl_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } auto FormatInstRHS(InterfaceDecl inst) -> void { FormatArgs(inst.interface_id); + llvm::SaveAndRestore class_scope( + scope_, inst_namer_->GetScopeFor(inst.interface_id)); + FormatTrailingBlock( + sem_ir_.interfaces().Get(inst.interface_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } diff --git a/toolchain/sem_ir/impl.h b/toolchain/sem_ir/impl.h index de9dc2bb6849..adc1d20f4f6d 100644 --- a/toolchain/sem_ir/impl.h +++ b/toolchain/sem_ir/impl.h @@ -28,6 +28,9 @@ struct Impl : public Printable { // The following members always have values, and do not change throughout the // lifetime of the interface. + // A block containing the pattern insts for the `impl forall` parameters, + // if any. + InstBlockId pattern_block_id = InstBlockId::Invalid; // TODO: Track the generic parameters for `impl forall`. // The type for which the impl is implementing a constraint. TypeId self_id; diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 487b6eb03353..76f12af2fcf6 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -31,6 +31,7 @@ CARBON_SEM_IR_INST_KIND(AssociatedEntityType) CARBON_SEM_IR_INST_KIND(BaseDecl) CARBON_SEM_IR_INST_KIND(BindAlias) CARBON_SEM_IR_INST_KIND(ExportDecl) +CARBON_SEM_IR_INST_KIND(BindingPattern) CARBON_SEM_IR_INST_KIND(BindName) CARBON_SEM_IR_INST_KIND(BindSymbolicName) CARBON_SEM_IR_INST_KIND(BindValue) @@ -84,6 +85,7 @@ CARBON_SEM_IR_INST_KIND(StructLiteral) CARBON_SEM_IR_INST_KIND(StructType) CARBON_SEM_IR_INST_KIND(StructTypeField) CARBON_SEM_IR_INST_KIND(StructValue) +CARBON_SEM_IR_INST_KIND(SymbolicBindingPattern) CARBON_SEM_IR_INST_KIND(TemporaryStorage) CARBON_SEM_IR_INST_KIND(Temporary) CARBON_SEM_IR_INST_KIND(TupleAccess) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 022ab102d670..05672d631ba8 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -22,7 +22,7 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, : tokenized_buffer_(tokenized_buffer), parse_tree_(parse_tree), sem_ir_(sem_ir) { - insts_.resize(sem_ir.insts().size()); + insts_.resize(sem_ir.insts().size(), {ScopeId::None, Namespace::Name()}); labels_.resize(sem_ir.inst_blocks().size()); scopes_.resize(static_cast(GetScopeFor(NumberOfScopesTag()))); generic_scopes_.resize(sem_ir.generics().size(), ScopeId::None); @@ -381,9 +381,15 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, auto untyped_inst = sem_ir_.insts().Get(inst_id); auto add_inst_name = [&](std::string name) { - insts_[inst_id.index] = { - scope_id, scope.insts.AllocateName( - *this, sem_ir_.insts().GetLocId(inst_id), name)}; + ScopeId old_scope_id = insts_[inst_id.index].first; + if (old_scope_id == ScopeId::None) { + insts_[inst_id.index] = { + scope_id, scope.insts.AllocateName( + *this, sem_ir_.insts().GetLocId(inst_id), name)}; + } else { + CARBON_CHECK(old_scope_id == scope_id, + "Attempting to name inst in multiple scopes"); + } }; auto add_inst_name_id = [&](NameId name_id, llvm::StringRef suffix = "") { add_inst_name( @@ -416,6 +422,13 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, sem_ir_.entity_names().Get(inst.entity_name_id).name_id); continue; } + case BindingPattern::Kind: + case SymbolicBindingPattern::Kind: { + auto inst = untyped_inst.As(); + add_inst_name_id( + sem_ir_.entity_names().Get(inst.entity_name_id).name_id, ".patt"); + continue; + } case CARBON_KIND(Call inst): { auto callee_function = SemIR::GetCalleeFunction(sem_ir_, inst.callee_id); @@ -437,8 +450,11 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(ClassDecl inst): { - add_inst_name_id(sem_ir_.classes().Get(inst.class_id).name_id, ".decl"); - CollectNamesInBlock(scope_id, inst.decl_block_id); + const auto& class_info = sem_ir_.classes().Get(inst.class_id); + add_inst_name_id(class_info.name_id, ".decl"); + auto class_scope_id = GetScopeFor(inst.class_id); + CollectNamesInBlock(class_scope_id, class_info.pattern_block_id); + CollectNamesInBlock(class_scope_id, inst.decl_block_id); continue; } case CARBON_KIND(ClassType inst): { @@ -446,9 +462,11 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(FunctionDecl inst): { - add_inst_name_id(sem_ir_.functions().Get(inst.function_id).name_id, - ".decl"); - CollectNamesInBlock(scope_id, inst.decl_block_id); + const auto& function_info = sem_ir_.functions().Get(inst.function_id); + add_inst_name_id(function_info.name_id, ".decl"); + auto function_scope_id = GetScopeFor(inst.function_id); + CollectNamesInBlock(function_scope_id, function_info.pattern_block_id); + CollectNamesInBlock(function_scope_id, inst.decl_block_id); continue; } case CARBON_KIND(FunctionType inst): { @@ -466,7 +484,10 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(ImplDecl inst): { - CollectNamesInBlock(scope_id, inst.decl_block_id); + auto impl_scope_id = GetScopeFor(inst.impl_id); + CollectNamesInBlock(impl_scope_id, + sem_ir_.impls().Get(inst.impl_id).pattern_block_id); + CollectNamesInBlock(impl_scope_id, inst.decl_block_id); break; } case CARBON_KIND(ImportDecl inst): { @@ -493,9 +514,13 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(InterfaceDecl inst): { - add_inst_name_id(sem_ir_.interfaces().Get(inst.interface_id).name_id, - ".decl"); - CollectNamesInBlock(scope_id, inst.decl_block_id); + const auto& interface_info = + sem_ir_.interfaces().Get(inst.interface_id); + add_inst_name_id(interface_info.name_id, ".decl"); + auto interface_scope_id = GetScopeFor(inst.interface_id); + CollectNamesInBlock(interface_scope_id, + interface_info.pattern_block_id); + CollectNamesInBlock(interface_scope_id, inst.decl_block_id); continue; } case CARBON_KIND(NameRef inst): { @@ -508,7 +533,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(Param inst): { - add_inst_name_id(inst.name_id); + add_inst_name_id(inst.name_id, ".param"); continue; } case CARBON_KIND(SpliceBlock inst): { diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 99e30a7796bc..d4f2221e4411 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -287,6 +287,36 @@ struct BindValue { InstId value_id; }; +// Common representation for various `*binding_pattern` nodes. +struct AnyBindingPattern { + // TODO: Also handle TemplateBindingPattern once it exists. + static constexpr InstKind Kinds[] = {InstKind::BindingPattern, + InstKind::SymbolicBindingPattern}; + + InstKind kind; + TypeId type_id; + EntityNameId entity_name_id; +}; + +// Represents a non-symbolic binding pattern. +struct BindingPattern { + static constexpr auto Kind = InstKind::BindingPattern.Define( + {.ir_name = "binding_pattern", .is_lowered = false}); + + TypeId type_id; + EntityNameId entity_name_id; +}; + +// Represents a symbolic binding pattern. +struct SymbolicBindingPattern { + static constexpr auto Kind = + InstKind::SymbolicBindingPattern.Define( + {.ir_name = "symbolic_binding_pattern", .is_lowered = false}); + + TypeId type_id; + EntityNameId entity_name_id; +}; + // Reads an argument from `BranchWithArg`. struct BlockArg { static constexpr auto Kind =