diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index 12e88b65d30a..65b469663c90 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -642,6 +642,8 @@ auto CheckUnit::FinishRun() -> void { block = context_.generated(); } else if (reserved_id == SemIR::InstBlockId::Imports) { block = context_.imports(); + } else if (reserved_id == SemIR::InstBlockId::ExtraGlobalVariables) { + block = context_.extra_global_variables(); } else { CARBON_FATAL("Unexpected reserved InstBlockId: {0}", reserved_id); } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 5545fe649d8a..d81eb46143a9 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -170,6 +170,10 @@ class Context { auto exports() -> llvm::SmallVector& { return exports_; } + auto extra_global_variables() -> llvm::SmallVector& { + return extra_global_variables_; + } + using CheckIRToImportIRStore = FixedSizeValueStore; auto check_ir_map() -> CheckIRToImportIRStore& { return check_ir_map_; } @@ -552,6 +556,10 @@ class Context { // `InstBlockId::Exports`. llvm::SmallVector exports_; + // Instructions that will be scanned for export as global variables. This + // becomes `InstBlockId::ExtraGlobalVariables`. + llvm::SmallVector extra_global_variables_; + // Maps CheckIRId to ImportIRId. CheckIRToImportIRStore check_ir_map_; diff --git a/toolchain/check/cpp/export.cpp b/toolchain/check/cpp/export.cpp index 144cf63d8a0d..36b45bb85148 100644 --- a/toolchain/check/cpp/export.cpp +++ b/toolchain/check/cpp/export.cpp @@ -12,6 +12,7 @@ #include "clang/Sema/EnterExpressionEvaluationContext.h" #include "clang/Sema/Sema.h" #include "llvm/Support/Casting.h" +#include "toolchain/base/kind_switch.h" #include "toolchain/check/cpp/access.h" #include "toolchain/check/cpp/context.h" #include "toolchain/check/cpp/import.h" @@ -745,13 +746,52 @@ auto ExportFieldToCpp(Context& context, SemIR::InstId field_inst_id, } namespace { + +// Given a block of parameter patterns, returns a vector of the same size, +// where each element of that vector contains the value used as the default +// value for that parameter, or `None` if no default value was specified. +static auto ExtractParameterDefaults(Context& context, + SemIR::InstBlockId param_patterns_id) + -> llvm::SmallVector { + llvm::SmallVector parameter_defaults; + for (auto inst_id : context.inst_blocks().Get(param_patterns_id)) { + auto pattern_id = context.constant_values().GetConstantInstId(inst_id); + while (pattern_id.has_value()) { + CARBON_KIND_SWITCH(context.insts().Get(pattern_id)) { + case CARBON_KIND(SemIR::DefaultValuePattern inst): { + parameter_defaults.push_back( + context.constant_values().Get(inst.value_id)); + pattern_id = SemIR::InstId::None; + break; + } + case CARBON_KIND_ANY(SemIR::AnyBindingPattern, inst): { + pattern_id = inst.subpattern_id; + break; + } + case CARBON_KIND_ANY(SemIR::AnyParamPattern, _): { + parameter_defaults.push_back(SemIR::ConstantId::None); + pattern_id = SemIR::InstId::None; + break; + } + default: { + pattern_id = SemIR::InstId::None; + break; + } + } + } + } + return parameter_defaults; +} + struct FunctionInfo { struct Param { - Param(Context& context, SemIR::InstId param_inst_id) + Param(Context& context, SemIR::InstId param_inst_id, + SemIR::ConstantId default_value_const_id) : pattern_inst_id(param_inst_id), type_id(ExtractScrutineeType( context.sem_ir(), context.insts().Get(param_inst_id).type_id())), - kind(GetParamPatternKind(context, param_inst_id)) {} + kind(GetParamPatternKind(context, param_inst_id)), + default_value_const_id(default_value_const_id) {} // The parameter's pattern type. SemIR::InstId pattern_inst_id; @@ -761,6 +801,10 @@ struct FunctionInfo { // Kind of the parameter pattern. ParamPatternKind kind; + + // ConstantId for a default value for the pattern, if specified, or `None` + // if the parameter pattern has no default value. + SemIR::ConstantId default_value_const_id; }; explicit FunctionInfo(Context& context, SemIR::FunctionId function_id, @@ -774,22 +818,33 @@ struct FunctionInfo { export_as_constructor(export_as_constructor) { auto function_params = context.inst_blocks().Get(function.call_param_patterns_id); + auto parameter_defaults = + ExtractParameterDefaults(context, function.param_patterns_id); const auto& ranges = function.call_param_ranges; + CARBON_CHECK(parameter_defaults.size() == + static_cast(ranges.explicit_size())); auto explicit_begin = ranges.explicit_begin().index; + auto param_start = explicit_begin; // Get the function's `self` parameter, if present. `self` is the first // explicit call parameter. (The lowered call parameters are leaf patterns // without binding names, so we rely on `self_param_id` and the positional // convention rather than inspecting the pattern.) if (function.self_param_id.has_value()) { - CARBON_CHECK(explicit_begin != ranges.explicit_end().index); - self_param = Param(context, function_params[explicit_begin]); - ++explicit_begin; + CARBON_CHECK(param_start != ranges.explicit_end().index); + self_param = + Param(context, function_params[param_start], SemIR::ConstantId::None); + ++param_start; } // The remaining explicit parameters are the caller-provided arguments. - for (auto i = explicit_begin; i != ranges.explicit_end().index; ++i) { - explicit_params.push_back(Param(context, function_params[i])); + for (auto i = param_start; i != ranges.explicit_end().index; ++i) { + // We only calculated default values for the explicit parameters, so + // we need to adjust the index within `parameter_defaults` by any elements + // in `function_params` that may have preceded them. + auto default_value_const_id = parameter_defaults[i - explicit_begin]; + explicit_params.push_back( + Param(context, function_params[i], default_value_const_id)); } } @@ -966,7 +1021,7 @@ static auto BuildCppFunctionDecl(Context& context, // Build parameter decls. llvm::SmallVector param_var_decls; - for (auto [i, type] : llvm::enumerate(param_types)) { + for (auto type : param_types) { auto* param_tinfo = context.ast_context().getTrivialTypeSourceInfo(type, clang_loc); clang::ParmVarDecl* param = clang::ParmVarDecl::Create( @@ -1175,6 +1230,95 @@ static auto BuildCppToCarbonThunkFunctionType(Context& context, ->getAs(); } +// Synthesizes a global variable with a value of `value_id` and exports it to +// clang. To generate a unique name, `parameter_index` should be the index of +// the parameter within the function. `pattern_id` is the parameter pattern. +// Returns a `clang::Expr*` suitable for conversion into an argument default +// value to provide to clang, or `nullptr` if `value_id` is None. +static auto BuildDefaultValueExpr(Context& context, SemIR::LocId loc_id, + const FunctionInfo& target, + int32_t parameter_index, + SemIR::InstId pattern_id, + SemIR::ConstantId value_id) -> clang::Expr* { + if (!value_id.has_value()) { + return nullptr; + } + + // Synthesize a global variable, initialized to the default value, for export + // to C++. + // TODO: making the mangler is expensive, we should cache and reuse it. + SemIR::Mangler mangler(context.sem_ir(), context.total_ir_count(), + context.mangle_string_fingerprint()); + auto mangled_fn_name = + mangler.Mangle(target.function_id, SemIR::SpecificId::None); + llvm::SmallString<64> var_name = llvm::formatv( + "__carbon_default_value_{}_{}", mangled_fn_name, parameter_index); + auto name_id = + SemIR::NameId::ForIdentifier(context.identifiers().Add(var_name)); + + // First we synthesize the variable definition by creating an EntityName from + // the generated name stored in `var_name`. We want to generate a + // `SemIR::VarStorage` instruction in the `InstBlockId::ExtraGlobalVariables` + // special block. During lowering this block is scanned for `VarStorage` + // instructions, and each one encountered is exported as a global variable + // with the associated typed storage. + auto pattern_type_id = context.insts().Get(pattern_id).type_id(); + // TODO: we are not storing the original TypeInstIds of the parameter patterns + // with the function, so the location of those instructions are lost in this + // entity. If we ever need to know that location (e.g. for diagnostics), we + // will need to preserve them with functions and then pipe that through here. + SemIR::EntityName entity_name = { + .name_id = name_id, + .parent_scope_id = SemIR::NameScopeId::Package, + .type_inst_id = context.types().GetTypeInstId(pattern_type_id), + }; + auto entity_name_id = context.entity_names().AddCanonical(entity_name); + + auto binding_pattern_id = AddInstInNoBlock( + context, loc_id, + {.type_id = pattern_type_id, .entity_name_id = entity_name_id}); + context.extra_global_variables().push_back(binding_pattern_id); + + auto var_pattern_id = AddInstInNoBlock( + context, SemIR::LocIdAndInst::RuntimeVerified( + context.sem_ir(), loc_id, + SemIR::VarPattern({.type_id = pattern_type_id, + .subpattern_id = binding_pattern_id}))); + context.extra_global_variables().push_back(var_pattern_id); + + auto var_storage_id = AddInstWithCleanupInNoBlock( + context, loc_id, + {.type_id = ExtractScrutineeType(context.sem_ir(), pattern_type_id), + .pattern_id = var_pattern_id}); + context.extra_global_variables().push_back(var_storage_id); + + // Add the variable initialization commands to the global initialization + // section so that it will have its value set before being referenced by the + // C++ code. Because we are exporting variables (vs. constants), we don't + // export the value of that default value, only the location of the global + // storage for that value. As a result, we must add instructions to + // the global initialization table to actually initialize that storage + // at binary startup time, so that when the C++ code dereferences + // it, the value is correct. + context.global_init().Resume(); + auto init_id = InitializeExisting( + context, loc_id, var_storage_id, + context.constant_values().GetInstId(value_id), /*for_return=*/false); + AddInst(context, loc_id, + {.lhs_id = var_storage_id, .rhs_id = init_id}); + context.global_init().Suspend(); + + auto* var_decl = + ExportVarToCpp(context, var_storage_id, + context.insts().GetAs(var_storage_id)); + auto decl_ref_expr = context.clang_sema().BuildDeclarationNameExpr( + clang::CXXScopeSpec(), + clang::DeclarationNameInfo(var_decl->getDeclName(), + clang::SourceLocation()), + var_decl); + return decl_ref_expr.get(); +} + // Create the declaration of the C++ thunk. static auto BuildCppToCarbonThunkDecl(Context& context, SemIR::LocId loc_id, const FunctionInfo& target, @@ -1255,10 +1399,20 @@ static auto BuildCppToCarbonThunkDecl(Context& context, SemIR::LocId loc_id, llvm::SmallVector param_var_decls; for (auto [i, type] : llvm::enumerate(thunk_function_type->param_types())) { + const auto& param = target.explicit_params[i]; clang::ParmVarDecl* thunk_param = clang::ParmVarDecl::Create( ast_context, thunk_function_decl, /*StartLoc=*/clang_loc, /*IdLoc=*/clang_loc, /*Id=*/nullptr, type, /*TInfo=*/nullptr, clang::SC_None, /*DefArg=*/nullptr); + if (auto* default_value_expr = BuildDefaultValueExpr( + context, loc_id, target, i, param.pattern_inst_id, + param.default_value_const_id)) { + auto converted_result = context.clang_sema().ConvertParamDefaultArgument( + thunk_param, default_value_expr, clang_loc); + CARBON_CHECK(!converted_result.isInvalid()); + context.clang_sema().SetParamDefaultArgument( + thunk_param, converted_result.get(), clang_loc); + } param_var_decls.push_back(thunk_param); } thunk_function_decl->setParams(param_var_decls); diff --git a/toolchain/check/testdata/basics/raw_sem_ir/builtins.carbon b/toolchain/check/testdata/basics/raw_sem_ir/builtins.carbon index 3a4dd3eb6f22..7406f8bbba8c 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/builtins.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/builtins.carbon @@ -105,7 +105,8 @@ // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block50000006: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: value_stores: // CHECK:STDOUT: shared_values: diff --git a/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon b/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon index c47d98ff5f97..6d7460a1b75d 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon @@ -38,15 +38,15 @@ fn F(generic Form: Core.Form) ->? Form; // CHECK:STDOUT: entity_name70000001: {name: name1, parent_scope: name_scope70000001, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: entity_name70000002: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0, form: inst, type: inst70000016} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block70000007, call_params_id: inst_block70000008, return_type_inst_id: inst7000001F, return_form_inst_id: inst7000001E, return_pattern_id: inst70000028} +// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block70000008, call_params_id: inst_block70000009, return_type_inst_id: inst7000001F, return_form_inst_id: inst7000001E, return_pattern_id: inst70000028} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} // CHECK:STDOUT: impls: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic70000000: {decl: inst70000031, bindings: inst_block7000000B, self_specific_id: specific70000000, decl_block_id: inst_block7000000D, definition_block_id: inst_block} +// CHECK:STDOUT: generic70000000: {decl: inst70000031, bindings: inst_block7000000C, self_specific_id: specific70000000, decl_block_id: inst_block7000000E, definition_block_id: inst_block} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific70000000: {generic: generic70000000, args: inst_block7000000C, identified: 0, decl_block_id: inst_block7000000E, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific70000000: {generic: generic70000000, args: inst_block7000000D, identified: 0, decl_block_id: inst_block7000000F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} // CHECK:STDOUT: specific_interfaces: {} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields_empty: {} @@ -118,13 +118,13 @@ fn F(generic Form: Core.Form) ->? Form; // CHECK:STDOUT: inst70000028: {kind: ReturnSlotPattern, arg0: inst70000024, arg1: inst7000001F, type: type(symbolic_constant7000000A)} // CHECK:STDOUT: inst70000029: {kind: ReturnSlotPattern, arg0: inst70000025, arg1: inst70000020, type: type(symbolic_constant70000007)} // CHECK:STDOUT: inst7000002A: {kind: ReturnSlotPattern, arg0: inst70000027, arg1: inst70000021, type: type(symbolic_constant7000000A)} -// CHECK:STDOUT: inst7000002B: {kind: SpliceBlock, arg0: inst_block70000005, arg1: inst70000016, type: type(TypeType)} +// CHECK:STDOUT: inst7000002B: {kind: SpliceBlock, arg0: inst_block70000006, arg1: inst70000016, type: type(TypeType)} // CHECK:STDOUT: inst7000002C: {kind: CalleePatternMatchAction, arg0: bundle70000000, type: type(inst(InstType))} // CHECK:STDOUT: inst7000002D: {kind: SpliceInst, arg0: inst7000002C, type: type(symbolic_constant70000006)} // CHECK:STDOUT: inst7000002E: {kind: SpliceInst, arg0: inst7000002C, type: type(symbolic_constant70000005)} // CHECK:STDOUT: inst7000002F: {kind: SpliceInst, arg0: inst7000002C, type: type(symbolic_constant70000006)} // CHECK:STDOUT: inst70000030: {kind: ReturnSlot, arg0: inst70000020, arg1: inst7000002D, type: type(symbolic_constant70000006)} -// CHECK:STDOUT: inst70000031: {kind: FunctionDecl, arg0: function70000000, arg1: inst_block7000000A, type: type(inst70000037)} +// CHECK:STDOUT: inst70000031: {kind: FunctionDecl, arg0: function70000000, arg1: inst_block7000000B, type: type(inst70000037)} // CHECK:STDOUT: inst70000032: {kind: OutFormParamPatternAction, arg0: inst7000001C, type: type(inst(InstType))} // CHECK:STDOUT: inst70000033: {kind: SpliceInst, arg0: inst70000032, type: type(symbolic_constant70000007)} // CHECK:STDOUT: inst70000034: {kind: ReturnSlotPattern, arg0: inst70000033, arg1: inst70000020, type: type(symbolic_constant70000007)} @@ -211,32 +211,33 @@ fn F(generic Form: Core.Form) ->? Form; // CHECK:STDOUT: 0: inst70000011 // CHECK:STDOUT: 1: inst70000015 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block70000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block70000006: // CHECK:STDOUT: 0: inst70000012 // CHECK:STDOUT: 1: inst70000014 // CHECK:STDOUT: 2: inst70000016 -// CHECK:STDOUT: inst_block70000006: -// CHECK:STDOUT: 0: inst70000018 // CHECK:STDOUT: inst_block70000007: -// CHECK:STDOUT: 0: inst70000024 +// CHECK:STDOUT: 0: inst70000018 // CHECK:STDOUT: inst_block70000008: -// CHECK:STDOUT: 0: inst7000002D +// CHECK:STDOUT: 0: inst70000024 // CHECK:STDOUT: inst_block70000009: +// CHECK:STDOUT: 0: inst7000002D +// CHECK:STDOUT: inst_block7000000A: // CHECK:STDOUT: 0: inst70000018 // CHECK:STDOUT: 1: inst70000024 // CHECK:STDOUT: 2: inst70000028 -// CHECK:STDOUT: inst_block7000000A: +// CHECK:STDOUT: inst_block7000000B: // CHECK:STDOUT: 0: inst7000001E // CHECK:STDOUT: 1: inst7000001F // CHECK:STDOUT: 2: inst7000002B // CHECK:STDOUT: 3: inst7000001B // CHECK:STDOUT: 4: inst7000002D // CHECK:STDOUT: 5: inst70000030 -// CHECK:STDOUT: inst_block7000000B: -// CHECK:STDOUT: 0: inst7000001B // CHECK:STDOUT: inst_block7000000C: -// CHECK:STDOUT: 0: inst7000001C +// CHECK:STDOUT: 0: inst7000001B // CHECK:STDOUT: inst_block7000000D: +// CHECK:STDOUT: 0: inst7000001C +// CHECK:STDOUT: inst_block7000000E: // CHECK:STDOUT: 0: inst7000001A // CHECK:STDOUT: 1: inst7000001D // CHECK:STDOUT: 2: inst70000021 @@ -246,7 +247,7 @@ fn F(generic Form: Core.Form) ->? Form; // CHECK:STDOUT: 6: inst7000002A // CHECK:STDOUT: 7: inst7000002C // CHECK:STDOUT: 8: inst7000002F -// CHECK:STDOUT: inst_block7000000E: +// CHECK:STDOUT: inst_block7000000F: // CHECK:STDOUT: 0: inst70000019 // CHECK:STDOUT: 1: inst7000001C // CHECK:STDOUT: 2: inst70000020 @@ -256,7 +257,7 @@ fn F(generic Form: Core.Form) ->? Form; // CHECK:STDOUT: 6: inst70000034 // CHECK:STDOUT: 7: inst70000035 // CHECK:STDOUT: 8: inst70000036 -// CHECK:STDOUT: inst_block7000000F: +// CHECK:STDOUT: inst_block70000010: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst70000010 // CHECK:STDOUT: 2: inst70000031 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon index 3d579ff6d40e..f7ed83bc8c13 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon @@ -78,13 +78,13 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: entity_name50000002: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: entity_name50000003: {name: name4, parent_scope: name_scope50000001, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block50000007, call_params_id: inst_block50000008, body: [inst_block5000000B]} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block50000008, call_params_id: inst_block50000009, body: [inst_block5000000C]} // CHECK:STDOUT: function50000001: {name: name3, parent_scope: name_scope50000001, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, cpp_thunk_decl: inst50000032} // CHECK:STDOUT: function50000002: {name: name6, parent_scope: name_scope50000001, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, cpp_thunk_callee: inst5000002F} -// CHECK:STDOUT: function50000003: {name: name3, parent_scope: name_scope50000001, call_param_patterns_id: inst_block50000010, call_params_id: inst_block50000011, cpp_thunk_decl: inst50000047} -// CHECK:STDOUT: function50000004: {name: name6, parent_scope: name_scope50000001, call_param_patterns_id: inst_block50000016, call_params_id: inst_block50000017, cpp_thunk_callee: inst5000003D} +// CHECK:STDOUT: function50000003: {name: name3, parent_scope: name_scope50000001, call_param_patterns_id: inst_block50000011, call_params_id: inst_block50000012, cpp_thunk_decl: inst50000047} +// CHECK:STDOUT: function50000004: {name: name6, parent_scope: name_scope50000001, call_param_patterns_id: inst_block50000017, call_params_id: inst_block50000018, cpp_thunk_callee: inst5000003D} // CHECK:STDOUT: classes: -// CHECK:STDOUT: class50000000: {name: name2, parent_scope: name_scope50000001, self_type_id: type(inst50000014), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope50000002, body_block_id: inst_block5000000D, adapt_id: inst, base_id: inst, complete_type_witness_id: inst50000027, vtable_decl_id: inst} +// CHECK:STDOUT: class50000000: {name: name2, parent_scope: name_scope50000001, self_type_id: type(inst50000014), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope50000002, body_block_id: inst_block5000000E, adapt_id: inst, base_id: inst, complete_type_witness_id: inst50000027, vtable_decl_id: inst} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} // CHECK:STDOUT: impls: {} @@ -215,8 +215,8 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst5000001A: {kind: WrapperBindingPattern, arg0: entity_name50000000, arg1: inst50000018, type: type(inst50000016)} // CHECK:STDOUT: inst5000001B: {kind: WrapperBinding, arg0: entity_name50000000, arg1: inst5000001C, type: type(inst50000014)} // CHECK:STDOUT: inst5000001C: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst50000014)} -// CHECK:STDOUT: inst5000001D: {kind: SpliceBlock, arg0: inst_block50000005, arg1: inst50000015, type: type(TypeType)} -// CHECK:STDOUT: inst5000001E: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000000A, type: type(inst5000001F)} +// CHECK:STDOUT: inst5000001D: {kind: SpliceBlock, arg0: inst_block50000006, arg1: inst50000015, type: type(TypeType)} +// CHECK:STDOUT: inst5000001E: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000000B, type: type(inst5000001F)} // CHECK:STDOUT: inst5000001F: {kind: FunctionType, arg0: function50000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst50000020: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst50000021: {kind: StructValue, arg0: inst_block_empty, type: type(inst5000001F)} @@ -247,7 +247,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst5000003A: {kind: WrapperBindingPattern, arg0: entity_name50000001, arg1: inst50000039, type: type(inst50000016)} // CHECK:STDOUT: inst5000003B: {kind: WrapperBinding, arg0: entity_name50000001, arg1: inst5000003C, type: type(inst50000014)} // CHECK:STDOUT: inst5000003C: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst50000014)} -// CHECK:STDOUT: inst5000003D: {kind: FunctionDecl, arg0: function50000003, arg1: inst_block50000013, type: type(inst5000003E)} +// CHECK:STDOUT: inst5000003D: {kind: FunctionDecl, arg0: function50000003, arg1: inst_block50000014, type: type(inst5000003E)} // CHECK:STDOUT: inst5000003E: {kind: FunctionType, arg0: function50000003, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst5000003F: {kind: StructValue, arg0: inst_block_empty, type: type(inst5000003E)} // CHECK:STDOUT: inst50000040: {kind: PatternType, arg0: inst50000022, type: type(TypeType)} @@ -257,12 +257,12 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst50000044: {kind: WrapperBindingPattern, arg0: entity_name50000000, arg1: inst50000042, type: type(inst50000040)} // CHECK:STDOUT: inst50000045: {kind: WrapperBinding, arg0: entity_name50000002, arg1: inst50000046, type: type(inst50000022)} // CHECK:STDOUT: inst50000046: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst50000022)} -// CHECK:STDOUT: inst50000047: {kind: FunctionDecl, arg0: function50000004, arg1: inst_block50000019, type: type(inst50000048)} +// CHECK:STDOUT: inst50000047: {kind: FunctionDecl, arg0: function50000004, arg1: inst_block5000001A, type: type(inst50000048)} // CHECK:STDOUT: inst50000048: {kind: FunctionType, arg0: function50000004, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst50000049: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000048)} // CHECK:STDOUT: inst5000004A: {kind: ValueAsRef, arg0: inst50000038, type: type(inst50000014)} // CHECK:STDOUT: inst5000004B: {kind: AddrOf, arg0: inst5000004A, type: type(inst50000022)} -// CHECK:STDOUT: inst5000004C: {kind: Call, arg0: inst50000047, arg1: inst_block5000001B, type: type(inst50000020)} +// CHECK:STDOUT: inst5000004C: {kind: Call, arg0: inst50000047, arg1: inst_block5000001C, type: type(inst50000020)} // CHECK:STDOUT: inst5000004D: {kind: NameRef, arg0: name(Cpp), arg1: inst50000011, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst5000004E: {kind: NameRef, arg0: name3, arg1: inst5000002C, type: type(inst5000002B)} // CHECK:STDOUT: inst5000004F: {kind: NameRef, arg0: name(Cpp), arg1: inst50000011, type: type(inst(NamespaceType))} @@ -277,7 +277,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst50000058: {kind: AcquireValue, arg0: inst50000057, type: type(inst50000014)} // CHECK:STDOUT: inst50000059: {kind: ValueAsRef, arg0: inst50000058, type: type(inst50000014)} // CHECK:STDOUT: inst5000005A: {kind: AddrOf, arg0: inst50000059, type: type(inst50000022)} -// CHECK:STDOUT: inst5000005B: {kind: Call, arg0: inst50000047, arg1: inst_block5000001D, type: type(inst50000020)} +// CHECK:STDOUT: inst5000005B: {kind: Call, arg0: inst50000047, arg1: inst_block5000001E, type: type(inst50000020)} // CHECK:STDOUT: inst5000005C: {kind: Return} // CHECK:STDOUT: bundles: {} // CHECK:STDOUT: constant_values: @@ -374,23 +374,24 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: 8: inst50000052 // CHECK:STDOUT: 9: inst50000054 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block50000006: // CHECK:STDOUT: 0: inst50000012 // CHECK:STDOUT: 1: inst50000015 -// CHECK:STDOUT: inst_block50000006: -// CHECK:STDOUT: 0: inst50000019 // CHECK:STDOUT: inst_block50000007: -// CHECK:STDOUT: 0: inst50000017 +// CHECK:STDOUT: 0: inst50000019 // CHECK:STDOUT: inst_block50000008: -// CHECK:STDOUT: 0: inst5000001C +// CHECK:STDOUT: 0: inst50000017 // CHECK:STDOUT: inst_block50000009: +// CHECK:STDOUT: 0: inst5000001C +// CHECK:STDOUT: inst_block5000000A: // CHECK:STDOUT: 0: inst50000017 // CHECK:STDOUT: 1: inst50000019 -// CHECK:STDOUT: inst_block5000000A: +// CHECK:STDOUT: inst_block5000000B: // CHECK:STDOUT: 0: inst5000001C // CHECK:STDOUT: 1: inst5000001D // CHECK:STDOUT: 2: inst5000001B -// CHECK:STDOUT: inst_block5000000B: +// CHECK:STDOUT: inst_block5000000C: // CHECK:STDOUT: 0: inst5000002A // CHECK:STDOUT: 1: inst5000002E // CHECK:STDOUT: 2: inst50000035 @@ -411,46 +412,46 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: 17: inst5000005A // CHECK:STDOUT: 18: inst5000005B // CHECK:STDOUT: 19: inst5000005C -// CHECK:STDOUT: inst_block5000000C: {} -// CHECK:STDOUT: inst_block5000000D: +// CHECK:STDOUT: inst_block5000000D: {} +// CHECK:STDOUT: inst_block5000000E: // CHECK:STDOUT: 0: inst50000024 // CHECK:STDOUT: 1: inst50000025 // CHECK:STDOUT: 2: inst50000027 -// CHECK:STDOUT: inst_block5000000E: {} -// CHECK:STDOUT: inst_block5000000F: -// CHECK:STDOUT: 0: inst5000003A +// CHECK:STDOUT: inst_block5000000F: {} // CHECK:STDOUT: inst_block50000010: -// CHECK:STDOUT: 0: inst50000039 +// CHECK:STDOUT: 0: inst5000003A // CHECK:STDOUT: inst_block50000011: -// CHECK:STDOUT: 0: inst5000003C +// CHECK:STDOUT: 0: inst50000039 // CHECK:STDOUT: inst_block50000012: +// CHECK:STDOUT: 0: inst5000003C +// CHECK:STDOUT: inst_block50000013: // CHECK:STDOUT: 0: inst50000039 // CHECK:STDOUT: 1: inst5000003A -// CHECK:STDOUT: inst_block50000013: +// CHECK:STDOUT: inst_block50000014: // CHECK:STDOUT: 0: inst5000003C // CHECK:STDOUT: 1: inst5000003B -// CHECK:STDOUT: inst_block50000014: {} -// CHECK:STDOUT: inst_block50000015: -// CHECK:STDOUT: 0: inst50000043 +// CHECK:STDOUT: inst_block50000015: {} // CHECK:STDOUT: inst_block50000016: -// CHECK:STDOUT: 0: inst50000041 +// CHECK:STDOUT: 0: inst50000043 // CHECK:STDOUT: inst_block50000017: -// CHECK:STDOUT: 0: inst50000046 +// CHECK:STDOUT: 0: inst50000041 // CHECK:STDOUT: inst_block50000018: +// CHECK:STDOUT: 0: inst50000046 +// CHECK:STDOUT: inst_block50000019: // CHECK:STDOUT: 0: inst50000041 // CHECK:STDOUT: 1: inst50000043 -// CHECK:STDOUT: inst_block50000019: +// CHECK:STDOUT: inst_block5000001A: // CHECK:STDOUT: 0: inst50000046 // CHECK:STDOUT: 1: inst50000045 -// CHECK:STDOUT: inst_block5000001A: -// CHECK:STDOUT: 0: inst50000038 // CHECK:STDOUT: inst_block5000001B: -// CHECK:STDOUT: 0: inst5000004B +// CHECK:STDOUT: 0: inst50000038 // CHECK:STDOUT: inst_block5000001C: -// CHECK:STDOUT: 0: inst50000058 +// CHECK:STDOUT: 0: inst5000004B // CHECK:STDOUT: inst_block5000001D: -// CHECK:STDOUT: 0: inst5000005A +// CHECK:STDOUT: 0: inst50000058 // CHECK:STDOUT: inst_block5000001E: +// CHECK:STDOUT: 0: inst5000005A +// CHECK:STDOUT: inst_block5000001F: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst50000010 // CHECK:STDOUT: 2: inst5000001E diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon index e012114e382c..c181771599e9 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon @@ -42,7 +42,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst(Package), parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst50000010}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000006]} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000007]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} @@ -115,10 +115,11 @@ fn B() { // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: {} -// CHECK:STDOUT: inst_block50000006: -// CHECK:STDOUT: 0: inst50000014 +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block50000006: {} // CHECK:STDOUT: inst_block50000007: +// CHECK:STDOUT: 0: inst50000014 +// CHECK:STDOUT: inst_block50000008: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst50000010 // CHECK:STDOUT: value_stores: @@ -150,7 +151,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name70000000: {name: name1, parent_scope: name_scope70000001, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block70000006]} +// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block70000007]} // CHECK:STDOUT: function70000001: {name: name1, parent_scope: name_scope70000001, call_param_patterns_id: inst_block_empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} @@ -243,13 +244,14 @@ fn B() { // CHECK:STDOUT: 1: inst70000017 // CHECK:STDOUT: 2: inst70000018 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block70000005: {} -// CHECK:STDOUT: inst_block70000006: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block70000006: {} +// CHECK:STDOUT: inst_block70000007: // CHECK:STDOUT: 0: inst70000016 // CHECK:STDOUT: 1: inst7000001B // CHECK:STDOUT: 2: inst7000001C // CHECK:STDOUT: 3: inst7000001D -// CHECK:STDOUT: inst_block70000007: +// CHECK:STDOUT: inst_block70000008: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst70000010 // CHECK:STDOUT: 2: inst70000012 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon index cac3b327fcec..d95f2b830286 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon @@ -42,7 +42,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst(Package), parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst50000010}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000006]} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000007]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} @@ -115,10 +115,11 @@ fn B() { // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: {} -// CHECK:STDOUT: inst_block50000006: -// CHECK:STDOUT: 0: inst50000014 +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block50000006: {} // CHECK:STDOUT: inst_block50000007: +// CHECK:STDOUT: 0: inst50000014 +// CHECK:STDOUT: inst_block50000008: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst50000010 // CHECK:STDOUT: value_stores: @@ -170,7 +171,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name70000000: {name: name1, parent_scope: name_scope70000001, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block70000006]} +// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block70000007]} // CHECK:STDOUT: function70000001: {name: name1, parent_scope: name_scope70000001, call_param_patterns_id: inst_block_empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} @@ -263,13 +264,14 @@ fn B() { // CHECK:STDOUT: 1: inst70000017 // CHECK:STDOUT: 2: inst70000018 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block70000005: {} -// CHECK:STDOUT: inst_block70000006: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block70000006: {} +// CHECK:STDOUT: inst_block70000007: // CHECK:STDOUT: 0: inst70000016 // CHECK:STDOUT: 1: inst7000001B // CHECK:STDOUT: 2: inst7000001C // CHECK:STDOUT: 3: inst7000001D -// CHECK:STDOUT: inst_block70000007: +// CHECK:STDOUT: inst_block70000008: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst70000010 // CHECK:STDOUT: 2: inst70000012 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/non_core_interfaces.carbon b/toolchain/check/testdata/basics/raw_sem_ir/non_core_interfaces.carbon index 51eaf5086394..e8434c503215 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/non_core_interfaces.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/non_core_interfaces.carbon @@ -64,9 +64,9 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: impls: {} // CHECK:STDOUT: generics: // CHECK:STDOUT: generic60000000: {decl: inst, bindings: inst_block, self_specific_id: specific, decl_block_id: inst_block, definition_block_id: inst_block} -// CHECK:STDOUT: generic60000001: {decl: inst60000015, bindings: inst_block60000005, self_specific_id: specific60000000, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} +// CHECK:STDOUT: generic60000001: {decl: inst60000015, bindings: inst_block60000006, self_specific_id: specific60000000, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific60000000: {generic: generic60000001, args: inst_block60000006, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific60000000: {generic: generic60000001, args: inst_block60000007, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} // CHECK:STDOUT: specific_interfaces: {} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields_empty: {} @@ -109,12 +109,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst60000014: {kind: SymbolicBinding, arg0: entity_name60000000, arg1: inst, type: type(inst60000011)} // CHECK:STDOUT: inst60000015: {kind: InterfaceWithSelfDecl, arg0: interface60000000} // CHECK:STDOUT: inst60000016: {kind: TypeLiteral, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst60000017: {kind: AssociatedConstantDecl, arg0: assoc_const60000000, arg1: inst_block6000000A, type: type(TypeType)} +// CHECK:STDOUT: inst60000017: {kind: AssociatedConstantDecl, arg0: assoc_const60000000, arg1: inst_block6000000B, type: type(TypeType)} // CHECK:STDOUT: inst60000018: {kind: AssociatedEntityType, arg0: interface60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000019: {kind: AssociatedEntity, arg0: element0, arg1: inst60000017, type: type(inst60000018)} // CHECK:STDOUT: inst6000001A: {kind: AssociatedEntity, arg0: element0, arg1: inst60000017, type: type(inst60000018)} // CHECK:STDOUT: inst6000001B: {kind: TypeLiteral, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst6000001C: {kind: AssociatedConstantDecl, arg0: assoc_const60000001, arg1: inst_block6000000C, type: type(TypeType)} +// CHECK:STDOUT: inst6000001C: {kind: AssociatedConstantDecl, arg0: assoc_const60000001, arg1: inst_block6000000D, type: type(TypeType)} // CHECK:STDOUT: inst6000001D: {kind: AssociatedEntity, arg0: element1, arg1: inst6000001C, type: type(inst60000018)} // CHECK:STDOUT: inst6000001E: {kind: AssociatedEntity, arg0: element1, arg1: inst6000001C, type: type(inst60000018)} // CHECK:STDOUT: bundles: {} @@ -147,28 +147,29 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block60000005: -// CHECK:STDOUT: 0: inst60000012 +// CHECK:STDOUT: extra_global_variables: {} // CHECK:STDOUT: inst_block60000006: -// CHECK:STDOUT: 0: inst60000013 +// CHECK:STDOUT: 0: inst60000012 // CHECK:STDOUT: inst_block60000007: +// CHECK:STDOUT: 0: inst60000013 +// CHECK:STDOUT: inst_block60000008: // CHECK:STDOUT: 0: inst60000012 // CHECK:STDOUT: 1: inst60000015 -// CHECK:STDOUT: inst_block60000008: -// CHECK:STDOUT: 0: inst60000017 -// CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: inst_block60000009: -// CHECK:STDOUT: 0: inst60000016 -// CHECK:STDOUT: inst_block6000000A: -// CHECK:STDOUT: 0: inst60000019 -// CHECK:STDOUT: inst_block6000000B: -// CHECK:STDOUT: 0: inst6000001B -// CHECK:STDOUT: inst_block6000000C: -// CHECK:STDOUT: 0: inst6000001D -// CHECK:STDOUT: inst_block6000000D: // CHECK:STDOUT: 0: inst60000017 // CHECK:STDOUT: 1: inst6000001C +// CHECK:STDOUT: inst_block6000000A: +// CHECK:STDOUT: 0: inst60000016 +// CHECK:STDOUT: inst_block6000000B: +// CHECK:STDOUT: 0: inst60000019 +// CHECK:STDOUT: inst_block6000000C: +// CHECK:STDOUT: 0: inst6000001B +// CHECK:STDOUT: inst_block6000000D: +// CHECK:STDOUT: 0: inst6000001D // CHECK:STDOUT: inst_block6000000E: +// CHECK:STDOUT: 0: inst60000017 +// CHECK:STDOUT: 1: inst6000001C +// CHECK:STDOUT: inst_block6000000F: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst60000010 // CHECK:STDOUT: value_stores: @@ -236,9 +237,9 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: entity_name5000000F: {name: name(Underscore), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 1, form: inst, type: inst500000EF} // CHECK:STDOUT: entity_name50000010: {name: name(Underscore), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 1, form: inst, type: inst500000FB} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name4, parent_scope: name_scope0, call_param_patterns_id: inst_block50000018, call_params_id: inst_block50000019, body: [inst_block5000001F]} -// CHECK:STDOUT: function50000001: {name: name7, parent_scope: name_scope0, call_param_patterns_id: inst_block50000028, call_params_id: inst_block50000029, body: [inst_block5000002F]} -// CHECK:STDOUT: function50000002: {name: name8, parent_scope: name_scope0, call_param_patterns_id: inst_block5000003E, call_params_id: inst_block5000003F, body: [inst_block50000045]} +// CHECK:STDOUT: function50000000: {name: name4, parent_scope: name_scope0, call_param_patterns_id: inst_block50000019, call_params_id: inst_block5000001A, body: [inst_block50000020]} +// CHECK:STDOUT: function50000001: {name: name7, parent_scope: name_scope0, call_param_patterns_id: inst_block50000029, call_params_id: inst_block5000002A, body: [inst_block50000030]} +// CHECK:STDOUT: function50000002: {name: name8, parent_scope: name_scope0, call_param_patterns_id: inst_block5000003F, call_params_id: inst_block50000040, body: [inst_block50000046]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: // CHECK:STDOUT: interface50000000: {name: name1, parent_scope: name_scope0, require_impls_block_id: require_block_empty} @@ -251,22 +252,22 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: impls: {} // CHECK:STDOUT: generics: // CHECK:STDOUT: generic50000000: {decl: inst, bindings: inst_block, self_specific_id: specific, decl_block_id: inst_block, definition_block_id: inst_block} -// CHECK:STDOUT: generic50000001: {decl: inst50000017, bindings: inst_block50000005, self_specific_id: specific50000000, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} -// CHECK:STDOUT: generic50000002: {decl: inst50000027, bindings: inst_block50000010, self_specific_id: specific50000001, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} -// CHECK:STDOUT: generic50000003: {decl: inst50000069, bindings: inst_block5000001C, self_specific_id: specific50000003, decl_block_id: inst_block5000001D, definition_block_id: inst_block50000020} -// CHECK:STDOUT: generic50000004: {decl: inst500000A8, bindings: inst_block5000002C, self_specific_id: specific50000005, decl_block_id: inst_block5000002D, definition_block_id: inst_block50000030} -// CHECK:STDOUT: generic50000005: {decl: inst5000010D, bindings: inst_block50000042, self_specific_id: specific50000009, decl_block_id: inst_block50000043, definition_block_id: inst_block50000046} +// CHECK:STDOUT: generic50000001: {decl: inst50000017, bindings: inst_block50000006, self_specific_id: specific50000000, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} +// CHECK:STDOUT: generic50000002: {decl: inst50000027, bindings: inst_block50000011, self_specific_id: specific50000001, decl_block_id: inst_block_empty, definition_block_id: inst_block_empty} +// CHECK:STDOUT: generic50000003: {decl: inst50000069, bindings: inst_block5000001D, self_specific_id: specific50000003, decl_block_id: inst_block5000001E, definition_block_id: inst_block50000021} +// CHECK:STDOUT: generic50000004: {decl: inst500000A8, bindings: inst_block5000002D, self_specific_id: specific50000005, decl_block_id: inst_block5000002E, definition_block_id: inst_block50000031} +// CHECK:STDOUT: generic50000005: {decl: inst5000010D, bindings: inst_block50000043, self_specific_id: specific50000009, decl_block_id: inst_block50000044, definition_block_id: inst_block50000047} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific50000000: {generic: generic50000001, args: inst_block50000006, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000001: {generic: generic50000002, args: inst_block50000011, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000002: {generic: generic50000002, args: inst_block50000014, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000003: {generic: generic50000003, args: inst_block50000014, identified: 0, decl_block_id: inst_block5000001E, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific50000004: {generic: generic50000001, args: inst_block50000024, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000005: {generic: generic50000004, args: inst_block50000024, identified: 0, decl_block_id: inst_block5000002E, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific50000006: {generic: generic50000001, args: inst_block50000032, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000007: {generic: generic50000001, args: inst_block50000038, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000008: {generic: generic50000001, args: inst_block5000003B, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} -// CHECK:STDOUT: specific50000009: {generic: generic50000005, args: inst_block50000038, identified: 0, decl_block_id: inst_block50000044, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific50000000: {generic: generic50000001, args: inst_block50000007, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000001: {generic: generic50000002, args: inst_block50000012, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000002: {generic: generic50000002, args: inst_block50000015, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000003: {generic: generic50000003, args: inst_block50000015, identified: 0, decl_block_id: inst_block5000001F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific50000004: {generic: generic50000001, args: inst_block50000025, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000005: {generic: generic50000004, args: inst_block50000025, identified: 0, decl_block_id: inst_block5000002F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific50000006: {generic: generic50000001, args: inst_block50000033, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000007: {generic: generic50000001, args: inst_block50000039, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000008: {generic: generic50000001, args: inst_block5000003C, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block_empty, definition_has_error: 0} +// CHECK:STDOUT: specific50000009: {generic: generic50000005, args: inst_block50000039, identified: 0, decl_block_id: inst_block50000045, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} // CHECK:STDOUT: specific_interfaces: // CHECK:STDOUT: specific_interface50000000: {interface_id: interface50000001, specific_id: specific} // CHECK:STDOUT: specific_interface50000001: {interface_id: interface50000000, specific_id: specific} @@ -381,12 +382,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst50000016: {kind: SymbolicBinding, arg0: entity_name50000000, arg1: inst, type: type(inst50000013)} // CHECK:STDOUT: inst50000017: {kind: InterfaceWithSelfDecl, arg0: interface50000000} // CHECK:STDOUT: inst50000018: {kind: TypeLiteral, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst50000019: {kind: AssociatedConstantDecl, arg0: assoc_const50000000, arg1: inst_block5000000A, type: type(TypeType)} +// CHECK:STDOUT: inst50000019: {kind: AssociatedConstantDecl, arg0: assoc_const50000000, arg1: inst_block5000000B, type: type(TypeType)} // CHECK:STDOUT: inst5000001A: {kind: AssociatedEntityType, arg0: interface50000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst5000001B: {kind: AssociatedEntity, arg0: element0, arg1: inst50000019, type: type(inst5000001A)} // CHECK:STDOUT: inst5000001C: {kind: AssociatedEntity, arg0: element0, arg1: inst50000019, type: type(inst5000001A)} // CHECK:STDOUT: inst5000001D: {kind: TypeLiteral, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst5000001E: {kind: AssociatedConstantDecl, arg0: assoc_const50000001, arg1: inst_block5000000C, type: type(TypeType)} +// CHECK:STDOUT: inst5000001E: {kind: AssociatedConstantDecl, arg0: assoc_const50000001, arg1: inst_block5000000D, type: type(TypeType)} // CHECK:STDOUT: inst5000001F: {kind: AssociatedEntity, arg0: element1, arg1: inst5000001E, type: type(inst5000001A)} // CHECK:STDOUT: inst50000020: {kind: AssociatedEntity, arg0: element1, arg1: inst5000001E, type: type(inst5000001A)} // CHECK:STDOUT: inst50000021: {kind: SymbolicBinding, arg0: entity_name50000001, arg1: inst, type: type(TypeType)} @@ -456,12 +457,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst50000061: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst5000005D, type: type(symbolic_constant50000016)} // CHECK:STDOUT: inst50000062: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst5000005F, type: type(symbolic_constant50000018)} // CHECK:STDOUT: inst50000063: {kind: WrapperBinding, arg0: entity_name50000009, arg1: inst50000067, type: type(symbolic_constant50000015)} -// CHECK:STDOUT: inst50000064: {kind: SpliceBlock, arg0: inst_block5000000E, arg1: inst5000002F, type: type(TypeType)} +// CHECK:STDOUT: inst50000064: {kind: SpliceBlock, arg0: inst_block5000000F, arg1: inst5000002F, type: type(TypeType)} // CHECK:STDOUT: inst50000065: {kind: ValueParam, arg0: call_param0, arg1: name(Underscore), type: type(symbolic_constant5000000D)} -// CHECK:STDOUT: inst50000066: {kind: SpliceBlock, arg0: inst_block50000013, arg1: inst50000043, type: type(TypeType)} +// CHECK:STDOUT: inst50000066: {kind: SpliceBlock, arg0: inst_block50000014, arg1: inst50000043, type: type(TypeType)} // CHECK:STDOUT: inst50000067: {kind: ValueParam, arg0: call_param1, arg1: name(Underscore), type: type(symbolic_constant50000015)} -// CHECK:STDOUT: inst50000068: {kind: SpliceBlock, arg0: inst_block50000016, arg1: inst50000058, type: type(TypeType)} -// CHECK:STDOUT: inst50000069: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000001B, type: type(inst5000006A)} +// CHECK:STDOUT: inst50000068: {kind: SpliceBlock, arg0: inst_block50000017, arg1: inst50000058, type: type(TypeType)} +// CHECK:STDOUT: inst50000069: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000001C, type: type(inst5000006A)} // CHECK:STDOUT: inst5000006A: {kind: FunctionType, arg0: function50000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst5000006B: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst5000006C: {kind: StructValue, arg0: inst_block_empty, type: type(inst5000006A)} @@ -519,12 +520,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst500000A0: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst5000009C, type: type(symbolic_constant50000032)} // CHECK:STDOUT: inst500000A1: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst5000009E, type: type(symbolic_constant50000034)} // CHECK:STDOUT: inst500000A2: {kind: WrapperBinding, arg0: entity_name5000000C, arg1: inst500000A6, type: type(symbolic_constant50000031)} -// CHECK:STDOUT: inst500000A3: {kind: SpliceBlock, arg0: inst_block50000021, arg1: inst50000075, type: type(TypeType)} +// CHECK:STDOUT: inst500000A3: {kind: SpliceBlock, arg0: inst_block50000022, arg1: inst50000075, type: type(TypeType)} // CHECK:STDOUT: inst500000A4: {kind: ValueParam, arg0: call_param0, arg1: name(Underscore), type: type(symbolic_constant50000029)} -// CHECK:STDOUT: inst500000A5: {kind: SpliceBlock, arg0: inst_block50000023, arg1: inst50000085, type: type(TypeType)} +// CHECK:STDOUT: inst500000A5: {kind: SpliceBlock, arg0: inst_block50000024, arg1: inst50000085, type: type(TypeType)} // CHECK:STDOUT: inst500000A6: {kind: ValueParam, arg0: call_param1, arg1: name(Underscore), type: type(symbolic_constant50000031)} -// CHECK:STDOUT: inst500000A7: {kind: SpliceBlock, arg0: inst_block50000026, arg1: inst50000097, type: type(TypeType)} -// CHECK:STDOUT: inst500000A8: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block5000002B, type: type(inst500000A9)} +// CHECK:STDOUT: inst500000A7: {kind: SpliceBlock, arg0: inst_block50000027, arg1: inst50000097, type: type(TypeType)} +// CHECK:STDOUT: inst500000A8: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block5000002C, type: type(inst500000A9)} // CHECK:STDOUT: inst500000A9: {kind: FunctionType, arg0: function50000001, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst500000AA: {kind: StructValue, arg0: inst_block_empty, type: type(inst500000A9)} // CHECK:STDOUT: inst500000AB: {kind: RequireCompleteType, arg0: inst50000086, type: type(inst(WitnessType))} @@ -570,7 +571,7 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst500000D3: {kind: ImplWitnessAccess, arg0: inst500000D2, arg1: element0, type: type(TypeType)} // CHECK:STDOUT: inst500000D4: {kind: ImplWitnessAccess, arg0: inst500000D2, arg1: element0, type: type(TypeType)} // CHECK:STDOUT: inst500000D5: {kind: RequirementRewrite, arg0: inst500000D3, arg1: inst500000C9} -// CHECK:STDOUT: inst500000D6: {kind: WhereExpr, arg0: inst_block50000035, type: type(TypeType)} +// CHECK:STDOUT: inst500000D6: {kind: WhereExpr, arg0: inst_block50000036, type: type(TypeType)} // CHECK:STDOUT: inst500000D7: {kind: FacetType, arg0: declared_facet_type50000003, type: type(TypeType)} // CHECK:STDOUT: inst500000D8: {kind: PatternType, arg0: inst500000D7, type: type(TypeType)} // CHECK:STDOUT: inst500000D9: {kind: SymbolicBindingPattern, arg0: entity_name5000000E, type: type(inst500000D8)} @@ -587,14 +588,14 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst500000E4: {kind: NameRef, arg0: name2, arg1: inst5000001B, type: type(inst5000001A)} // CHECK:STDOUT: inst500000E5: {kind: LookupImplWitness, arg0: inst500000DD, arg1: specific_interface50000001, type: type(inst(WitnessType))} // CHECK:STDOUT: inst500000E6: {kind: IdentifiedWitness, arg0: inst500000DD, arg1: specific_interface50000001, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst500000E7: {kind: FacetValue, arg0: inst500000E1, arg1: inst_block50000039, type: type(inst50000013)} +// CHECK:STDOUT: inst500000E7: {kind: FacetValue, arg0: inst500000E1, arg1: inst_block5000003A, type: type(inst50000013)} // CHECK:STDOUT: inst500000E8: {kind: LookupImplWitness, arg0: inst500000E7, arg1: specific_interface50000001, type: type(inst(WitnessType))} // CHECK:STDOUT: inst500000E9: {kind: ImplWitnessAccess, arg0: inst500000E6, arg1: element0, type: type(TypeType)} // CHECK:STDOUT: inst500000EA: {kind: ImplWitnessAccess, arg0: inst500000E6, arg1: element0, type: type(TypeType)} // CHECK:STDOUT: inst500000EB: {kind: FacetType, arg0: declared_facet_type50000004, type: type(TypeType)} // CHECK:STDOUT: inst500000EC: {kind: LookupImplWitness, arg0: inst500000DD, arg1: specific_interface50000001, type: type(inst(WitnessType))} // CHECK:STDOUT: inst500000ED: {kind: LookupImplWitness, arg0: inst500000DD, arg1: specific_interface50000001, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst500000EE: {kind: FacetValue, arg0: inst500000E1, arg1: inst_block5000003A, type: type(inst50000013)} +// CHECK:STDOUT: inst500000EE: {kind: FacetValue, arg0: inst500000E1, arg1: inst_block5000003B, type: type(inst50000013)} // CHECK:STDOUT: inst500000EF: {kind: ImplWitnessAccess, arg0: inst500000ED, arg1: element0, type: type(TypeType)} // CHECK:STDOUT: inst500000F0: {kind: PatternType, arg0: inst5000006B, type: type(TypeType)} // CHECK:STDOUT: inst500000F1: {kind: ValueParamPattern, arg0: name(Underscore), type: type(inst500000F0)} @@ -620,12 +621,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: inst50000105: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst50000101, type: type(symbolic_constant50000053)} // CHECK:STDOUT: inst50000106: {kind: WrapperBindingPattern, arg0: entity_name50000008, arg1: inst50000103, type: type(symbolic_constant50000055)} // CHECK:STDOUT: inst50000107: {kind: WrapperBinding, arg0: entity_name50000010, arg1: inst5000010B, type: type(symbolic_constant50000052)} -// CHECK:STDOUT: inst50000108: {kind: SpliceBlock, arg0: inst_block50000031, arg1: inst500000D6, type: type(TypeType)} +// CHECK:STDOUT: inst50000108: {kind: SpliceBlock, arg0: inst_block50000032, arg1: inst500000D6, type: type(TypeType)} // CHECK:STDOUT: inst50000109: {kind: ValueParam, arg0: call_param0, arg1: name(Underscore), type: type(inst5000006B)} -// CHECK:STDOUT: inst5000010A: {kind: SpliceBlock, arg0: inst_block50000037, arg1: inst500000EF, type: type(TypeType)} +// CHECK:STDOUT: inst5000010A: {kind: SpliceBlock, arg0: inst_block50000038, arg1: inst500000EF, type: type(TypeType)} // CHECK:STDOUT: inst5000010B: {kind: ValueParam, arg0: call_param1, arg1: name(Underscore), type: type(symbolic_constant50000052)} -// CHECK:STDOUT: inst5000010C: {kind: SpliceBlock, arg0: inst_block5000003C, arg1: inst500000FB, type: type(TypeType)} -// CHECK:STDOUT: inst5000010D: {kind: FunctionDecl, arg0: function50000002, arg1: inst_block50000041, type: type(inst5000010E)} +// CHECK:STDOUT: inst5000010C: {kind: SpliceBlock, arg0: inst_block5000003D, arg1: inst500000FB, type: type(TypeType)} +// CHECK:STDOUT: inst5000010D: {kind: FunctionDecl, arg0: function50000002, arg1: inst_block50000042, type: type(inst5000010E)} // CHECK:STDOUT: inst5000010E: {kind: FunctionType, arg0: function50000002, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst5000010F: {kind: StructValue, arg0: inst_block_empty, type: type(inst5000010E)} // CHECK:STDOUT: inst50000110: {kind: RequireCompleteType, arg0: inst500000FC, type: type(inst(WitnessType))} @@ -986,72 +987,73 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 12: inst50000053 // CHECK:STDOUT: 13: inst50000057 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: -// CHECK:STDOUT: 0: inst50000014 +// CHECK:STDOUT: extra_global_variables: {} // CHECK:STDOUT: inst_block50000006: -// CHECK:STDOUT: 0: inst50000015 +// CHECK:STDOUT: 0: inst50000014 // CHECK:STDOUT: inst_block50000007: +// CHECK:STDOUT: 0: inst50000015 +// CHECK:STDOUT: inst_block50000008: // CHECK:STDOUT: 0: inst50000014 // CHECK:STDOUT: 1: inst50000017 -// CHECK:STDOUT: inst_block50000008: -// CHECK:STDOUT: 0: inst50000019 -// CHECK:STDOUT: 1: inst5000001E // CHECK:STDOUT: inst_block50000009: -// CHECK:STDOUT: 0: inst50000018 -// CHECK:STDOUT: inst_block5000000A: -// CHECK:STDOUT: 0: inst5000001B -// CHECK:STDOUT: inst_block5000000B: -// CHECK:STDOUT: 0: inst5000001D -// CHECK:STDOUT: inst_block5000000C: -// CHECK:STDOUT: 0: inst5000001F -// CHECK:STDOUT: inst_block5000000D: // CHECK:STDOUT: 0: inst50000019 // CHECK:STDOUT: 1: inst5000001E +// CHECK:STDOUT: inst_block5000000A: +// CHECK:STDOUT: 0: inst50000018 +// CHECK:STDOUT: inst_block5000000B: +// CHECK:STDOUT: 0: inst5000001B +// CHECK:STDOUT: inst_block5000000C: +// CHECK:STDOUT: 0: inst5000001D +// CHECK:STDOUT: inst_block5000000D: +// CHECK:STDOUT: 0: inst5000001F // CHECK:STDOUT: inst_block5000000E: +// CHECK:STDOUT: 0: inst50000019 +// CHECK:STDOUT: 1: inst5000001E +// CHECK:STDOUT: inst_block5000000F: // CHECK:STDOUT: 0: inst50000021 // CHECK:STDOUT: 1: inst50000023 // CHECK:STDOUT: 2: inst5000002F -// CHECK:STDOUT: inst_block5000000F: +// CHECK:STDOUT: inst_block50000010: // CHECK:STDOUT: 0: inst5000002B // CHECK:STDOUT: 1: inst5000002C -// CHECK:STDOUT: inst_block50000010: -// CHECK:STDOUT: 0: inst5000002D // CHECK:STDOUT: inst_block50000011: -// CHECK:STDOUT: 0: inst50000028 +// CHECK:STDOUT: 0: inst5000002D // CHECK:STDOUT: inst_block50000012: -// CHECK:STDOUT: 0: inst50000031 +// CHECK:STDOUT: 0: inst50000028 // CHECK:STDOUT: inst_block50000013: +// CHECK:STDOUT: 0: inst50000031 +// CHECK:STDOUT: inst_block50000014: // CHECK:STDOUT: 0: inst50000037 // CHECK:STDOUT: 1: inst50000038 // CHECK:STDOUT: 2: inst5000003B // CHECK:STDOUT: 3: inst5000003F // CHECK:STDOUT: 4: inst50000043 -// CHECK:STDOUT: inst_block50000014: -// CHECK:STDOUT: 0: inst50000035 // CHECK:STDOUT: inst_block50000015: -// CHECK:STDOUT: 0: inst50000041 +// CHECK:STDOUT: 0: inst50000035 // CHECK:STDOUT: inst_block50000016: +// CHECK:STDOUT: 0: inst50000041 +// CHECK:STDOUT: inst_block50000017: // CHECK:STDOUT: 0: inst50000050 // CHECK:STDOUT: 1: inst50000051 // CHECK:STDOUT: 2: inst50000052 // CHECK:STDOUT: 3: inst50000055 // CHECK:STDOUT: 4: inst50000058 -// CHECK:STDOUT: inst_block50000017: +// CHECK:STDOUT: inst_block50000018: // CHECK:STDOUT: 0: inst5000004C // CHECK:STDOUT: 1: inst50000060 -// CHECK:STDOUT: inst_block50000018: +// CHECK:STDOUT: inst_block50000019: // CHECK:STDOUT: 0: inst50000048 // CHECK:STDOUT: 1: inst5000005C -// CHECK:STDOUT: inst_block50000019: +// CHECK:STDOUT: inst_block5000001A: // CHECK:STDOUT: 0: inst50000065 // CHECK:STDOUT: 1: inst50000067 -// CHECK:STDOUT: inst_block5000001A: +// CHECK:STDOUT: inst_block5000001B: // CHECK:STDOUT: 0: inst50000031 // CHECK:STDOUT: 1: inst50000048 // CHECK:STDOUT: 2: inst5000004C // CHECK:STDOUT: 3: inst5000005C // CHECK:STDOUT: 4: inst50000060 -// CHECK:STDOUT: inst_block5000001B: +// CHECK:STDOUT: inst_block5000001C: // CHECK:STDOUT: 0: inst50000064 // CHECK:STDOUT: 1: inst50000034 // CHECK:STDOUT: 2: inst50000065 @@ -1060,9 +1062,9 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 5: inst50000067 // CHECK:STDOUT: 6: inst50000068 // CHECK:STDOUT: 7: inst50000063 -// CHECK:STDOUT: inst_block5000001C: -// CHECK:STDOUT: 0: inst50000034 // CHECK:STDOUT: inst_block5000001D: +// CHECK:STDOUT: 0: inst50000034 +// CHECK:STDOUT: inst_block5000001E: // CHECK:STDOUT: 0: inst50000033 // CHECK:STDOUT: 1: inst50000036 // CHECK:STDOUT: 2: inst5000003A @@ -1075,7 +1077,7 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 9: inst5000005E // CHECK:STDOUT: 10: inst5000005F // CHECK:STDOUT: 11: inst50000062 -// CHECK:STDOUT: inst_block5000001E: +// CHECK:STDOUT: inst_block5000001F: // CHECK:STDOUT: 0: inst50000032 // CHECK:STDOUT: 1: inst50000035 // CHECK:STDOUT: 2: inst50000039 @@ -1088,48 +1090,48 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 9: inst5000005B // CHECK:STDOUT: 10: inst5000005D // CHECK:STDOUT: 11: inst50000061 -// CHECK:STDOUT: inst_block5000001F: -// CHECK:STDOUT: 0: inst50000073 // CHECK:STDOUT: inst_block50000020: +// CHECK:STDOUT: 0: inst50000073 +// CHECK:STDOUT: inst_block50000021: // CHECK:STDOUT: 0: inst5000006F // CHECK:STDOUT: 1: inst50000072 -// CHECK:STDOUT: inst_block50000021: +// CHECK:STDOUT: inst_block50000022: // CHECK:STDOUT: 0: inst50000074 // CHECK:STDOUT: 1: inst50000075 -// CHECK:STDOUT: inst_block50000022: -// CHECK:STDOUT: 0: inst50000077 // CHECK:STDOUT: inst_block50000023: +// CHECK:STDOUT: 0: inst50000077 +// CHECK:STDOUT: inst_block50000024: // CHECK:STDOUT: 0: inst5000007D // CHECK:STDOUT: 1: inst5000007E // CHECK:STDOUT: 2: inst50000081 // CHECK:STDOUT: 3: inst50000082 // CHECK:STDOUT: 4: inst50000085 -// CHECK:STDOUT: inst_block50000024: -// CHECK:STDOUT: 0: inst5000007B // CHECK:STDOUT: inst_block50000025: -// CHECK:STDOUT: 0: inst50000084 +// CHECK:STDOUT: 0: inst5000007B // CHECK:STDOUT: inst_block50000026: +// CHECK:STDOUT: 0: inst50000084 +// CHECK:STDOUT: inst_block50000027: // CHECK:STDOUT: 0: inst50000092 // CHECK:STDOUT: 1: inst50000093 // CHECK:STDOUT: 2: inst50000094 // CHECK:STDOUT: 3: inst50000095 // CHECK:STDOUT: 4: inst50000097 -// CHECK:STDOUT: inst_block50000027: +// CHECK:STDOUT: inst_block50000028: // CHECK:STDOUT: 0: inst5000008E // CHECK:STDOUT: 1: inst5000009F -// CHECK:STDOUT: inst_block50000028: +// CHECK:STDOUT: inst_block50000029: // CHECK:STDOUT: 0: inst5000008A // CHECK:STDOUT: 1: inst5000009B -// CHECK:STDOUT: inst_block50000029: +// CHECK:STDOUT: inst_block5000002A: // CHECK:STDOUT: 0: inst500000A4 // CHECK:STDOUT: 1: inst500000A6 -// CHECK:STDOUT: inst_block5000002A: +// CHECK:STDOUT: inst_block5000002B: // CHECK:STDOUT: 0: inst50000077 // CHECK:STDOUT: 1: inst5000008A // CHECK:STDOUT: 2: inst5000008E // CHECK:STDOUT: 3: inst5000009B // CHECK:STDOUT: 4: inst5000009F -// CHECK:STDOUT: inst_block5000002B: +// CHECK:STDOUT: inst_block5000002C: // CHECK:STDOUT: 0: inst500000A3 // CHECK:STDOUT: 1: inst5000007A // CHECK:STDOUT: 2: inst500000A4 @@ -1138,9 +1140,9 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 5: inst500000A6 // CHECK:STDOUT: 6: inst500000A7 // CHECK:STDOUT: 7: inst500000A2 -// CHECK:STDOUT: inst_block5000002C: -// CHECK:STDOUT: 0: inst5000007A // CHECK:STDOUT: inst_block5000002D: +// CHECK:STDOUT: 0: inst5000007A +// CHECK:STDOUT: inst_block5000002E: // CHECK:STDOUT: 0: inst50000079 // CHECK:STDOUT: 1: inst5000007C // CHECK:STDOUT: 2: inst50000080 @@ -1153,7 +1155,7 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 9: inst5000009D // CHECK:STDOUT: 10: inst5000009E // CHECK:STDOUT: 11: inst500000A1 -// CHECK:STDOUT: inst_block5000002E: +// CHECK:STDOUT: inst_block5000002F: // CHECK:STDOUT: 0: inst50000078 // CHECK:STDOUT: 1: inst5000007B // CHECK:STDOUT: 2: inst5000007F @@ -1166,12 +1168,12 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 9: inst5000009A // CHECK:STDOUT: 10: inst5000009C // CHECK:STDOUT: 11: inst500000A0 -// CHECK:STDOUT: inst_block5000002F: -// CHECK:STDOUT: 0: inst500000B1 // CHECK:STDOUT: inst_block50000030: +// CHECK:STDOUT: 0: inst500000B1 +// CHECK:STDOUT: inst_block50000031: // CHECK:STDOUT: 0: inst500000AD // CHECK:STDOUT: 1: inst500000B0 -// CHECK:STDOUT: inst_block50000031: +// CHECK:STDOUT: inst_block50000032: // CHECK:STDOUT: 0: inst500000B2 // CHECK:STDOUT: 1: inst500000B3 // CHECK:STDOUT: 2: inst500000B4 @@ -1198,56 +1200,56 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 23: inst500000D3 // CHECK:STDOUT: 24: inst500000D5 // CHECK:STDOUT: 25: inst500000D6 -// CHECK:STDOUT: inst_block50000032: -// CHECK:STDOUT: 0: inst500000B5 // CHECK:STDOUT: inst_block50000033: -// CHECK:STDOUT: 0: inst500000C4 +// CHECK:STDOUT: 0: inst500000B5 // CHECK:STDOUT: inst_block50000034: +// CHECK:STDOUT: 0: inst500000C4 +// CHECK:STDOUT: inst_block50000035: // CHECK:STDOUT: 0: inst500000B6 // CHECK:STDOUT: 1: inst500000BD // CHECK:STDOUT: 2: inst500000CA -// CHECK:STDOUT: inst_block50000035: +// CHECK:STDOUT: inst_block50000036: // CHECK:STDOUT: 0: inst500000B6 // CHECK:STDOUT: 1: inst500000D0 // CHECK:STDOUT: 2: inst500000D5 -// CHECK:STDOUT: inst_block50000036: -// CHECK:STDOUT: 0: inst500000D9 // CHECK:STDOUT: inst_block50000037: +// CHECK:STDOUT: 0: inst500000D9 +// CHECK:STDOUT: inst_block50000038: // CHECK:STDOUT: 0: inst500000DF // CHECK:STDOUT: 1: inst500000E0 // CHECK:STDOUT: 2: inst500000E3 // CHECK:STDOUT: 3: inst500000E4 // CHECK:STDOUT: 4: inst500000EF -// CHECK:STDOUT: inst_block50000038: -// CHECK:STDOUT: 0: inst500000DD // CHECK:STDOUT: inst_block50000039: -// CHECK:STDOUT: 0: inst500000E6 +// CHECK:STDOUT: 0: inst500000DD // CHECK:STDOUT: inst_block5000003A: -// CHECK:STDOUT: 0: inst500000ED +// CHECK:STDOUT: 0: inst500000E6 // CHECK:STDOUT: inst_block5000003B: -// CHECK:STDOUT: 0: inst500000EE +// CHECK:STDOUT: 0: inst500000ED // CHECK:STDOUT: inst_block5000003C: +// CHECK:STDOUT: 0: inst500000EE +// CHECK:STDOUT: inst_block5000003D: // CHECK:STDOUT: 0: inst500000F6 // CHECK:STDOUT: 1: inst500000F7 // CHECK:STDOUT: 2: inst500000F8 // CHECK:STDOUT: 3: inst500000F9 // CHECK:STDOUT: 4: inst500000FB -// CHECK:STDOUT: inst_block5000003D: +// CHECK:STDOUT: inst_block5000003E: // CHECK:STDOUT: 0: inst500000F3 // CHECK:STDOUT: 1: inst50000104 -// CHECK:STDOUT: inst_block5000003E: +// CHECK:STDOUT: inst_block5000003F: // CHECK:STDOUT: 0: inst500000F1 // CHECK:STDOUT: 1: inst50000100 -// CHECK:STDOUT: inst_block5000003F: +// CHECK:STDOUT: inst_block50000040: // CHECK:STDOUT: 0: inst50000109 // CHECK:STDOUT: 1: inst5000010B -// CHECK:STDOUT: inst_block50000040: +// CHECK:STDOUT: inst_block50000041: // CHECK:STDOUT: 0: inst500000D9 // CHECK:STDOUT: 1: inst500000F1 // CHECK:STDOUT: 2: inst500000F3 // CHECK:STDOUT: 3: inst50000100 // CHECK:STDOUT: 4: inst50000104 -// CHECK:STDOUT: inst_block50000041: +// CHECK:STDOUT: inst_block50000042: // CHECK:STDOUT: 0: inst50000108 // CHECK:STDOUT: 1: inst500000DC // CHECK:STDOUT: 2: inst50000109 @@ -1256,9 +1258,9 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 5: inst5000010B // CHECK:STDOUT: 6: inst5000010C // CHECK:STDOUT: 7: inst50000107 -// CHECK:STDOUT: inst_block50000042: -// CHECK:STDOUT: 0: inst500000DC // CHECK:STDOUT: inst_block50000043: +// CHECK:STDOUT: 0: inst500000DC +// CHECK:STDOUT: inst_block50000044: // CHECK:STDOUT: 0: inst500000DB // CHECK:STDOUT: 1: inst500000DE // CHECK:STDOUT: 2: inst500000E2 @@ -1267,7 +1269,7 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 5: inst50000102 // CHECK:STDOUT: 6: inst50000103 // CHECK:STDOUT: 7: inst50000106 -// CHECK:STDOUT: inst_block50000044: +// CHECK:STDOUT: inst_block50000045: // CHECK:STDOUT: 0: inst500000DA // CHECK:STDOUT: 1: inst500000DD // CHECK:STDOUT: 2: inst500000E1 @@ -1276,11 +1278,11 @@ fn HasRewrites[T: Copy where .Self impls NonCore.Destroy and .T1 = ()](_: T.T1, // CHECK:STDOUT: 5: inst500000FF // CHECK:STDOUT: 6: inst50000101 // CHECK:STDOUT: 7: inst50000105 -// CHECK:STDOUT: inst_block50000045: -// CHECK:STDOUT: 0: inst50000113 // CHECK:STDOUT: inst_block50000046: -// CHECK:STDOUT: 0: inst50000112 +// CHECK:STDOUT: 0: inst50000113 // CHECK:STDOUT: inst_block50000047: +// CHECK:STDOUT: 0: inst50000112 +// CHECK:STDOUT: inst_block50000048: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst50000010 // CHECK:STDOUT: 2: inst50000012 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index 184b375b7bd0..e0793b76e4f2 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -385,12 +385,12 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: entity_name78000044: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: entity_name78000045: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0, form: inst, type: inst} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function78000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block78000010, call_params_id: inst_block78000011, return_type_inst_id: inst78000035, return_form_inst_id: inst78000037, return_pattern_id: inst7800003F, body: [inst_block78000018]} -// CHECK:STDOUT: function78000001: {name: name4, parent_scope: name_scope78000003, call_param_patterns_id: inst_block7800001E, return_type_inst_id: inst78000071, return_form_inst_id: inst78000072, return_pattern_id: inst78000073} -// CHECK:STDOUT: function78000002: {name: name4, parent_scope: name_scope78000004, call_param_patterns_id: inst_block78000029, return_type_inst_id: inst780000A3, return_form_inst_id: inst780000A4, return_pattern_id: inst780000A5} -// CHECK:STDOUT: function78000003: {name: name4, parent_scope: name_scope78000009, call_param_patterns_id: inst_block7800003F, return_type_inst_id: inst7800010E, return_form_inst_id: inst7800010F, return_pattern_id: inst78000110, builtin: primitive_copy} -// CHECK:STDOUT: function78000004: {name: name4, parent_scope: name_scope7800000C, call_param_patterns_id: inst_block7800004C, return_type_inst_id: inst78000148, return_form_inst_id: inst78000149, return_pattern_id: inst7800014A} -// CHECK:STDOUT: function78000005: {name: name4, parent_scope: name_scope7800000D, call_param_patterns_id: inst_block78000068, return_type_inst_id: inst780001A7, return_form_inst_id: inst780001A8, return_pattern_id: inst780001A9} +// CHECK:STDOUT: function78000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block78000011, call_params_id: inst_block78000012, return_type_inst_id: inst78000035, return_form_inst_id: inst78000037, return_pattern_id: inst7800003F, body: [inst_block78000019]} +// CHECK:STDOUT: function78000001: {name: name4, parent_scope: name_scope78000003, call_param_patterns_id: inst_block7800001F, return_type_inst_id: inst78000071, return_form_inst_id: inst78000072, return_pattern_id: inst78000073} +// CHECK:STDOUT: function78000002: {name: name4, parent_scope: name_scope78000004, call_param_patterns_id: inst_block7800002A, return_type_inst_id: inst780000A3, return_form_inst_id: inst780000A4, return_pattern_id: inst780000A5} +// CHECK:STDOUT: function78000003: {name: name4, parent_scope: name_scope78000009, call_param_patterns_id: inst_block78000040, return_type_inst_id: inst7800010E, return_form_inst_id: inst7800010F, return_pattern_id: inst78000110, builtin: primitive_copy} +// CHECK:STDOUT: function78000004: {name: name4, parent_scope: name_scope7800000C, call_param_patterns_id: inst_block7800004D, return_type_inst_id: inst78000148, return_form_inst_id: inst78000149, return_pattern_id: inst7800014A} +// CHECK:STDOUT: function78000005: {name: name4, parent_scope: name_scope7800000D, call_param_patterns_id: inst_block78000069, return_type_inst_id: inst780001A7, return_form_inst_id: inst780001A8, return_pattern_id: inst780001A9} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: // CHECK:STDOUT: interface78000000: {name: name3, parent_scope: name_scope78000001, require_impls_block_id: require_block_empty, core_interface: Copy} @@ -407,57 +407,57 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: impl78000008: {self: inst78000179, constraint: inst7800017A, witness: inst7800012B} // CHECK:STDOUT: impl78000009: {self: inst780001E2, constraint: inst780001E3, witness: inst7800018A} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic78000000: {decl: inst78000047, bindings: inst_block78000014, self_specific_id: specific78000000, decl_block_id: inst_block78000016, definition_block_id: inst_block7800008B} -// CHECK:STDOUT: generic78000001: {decl: inst7800005A, bindings: inst_block7800001B, self_specific_id: specific78000001, decl_block_id: inst_block_empty, definition_block_id: inst_block78000024} -// CHECK:STDOUT: generic78000002: {decl: inst7800005F, bindings: inst_block78000020, self_specific_id: specific78000002, decl_block_id: inst_block78000021, definition_block_id: inst_block} -// CHECK:STDOUT: generic78000003: {decl: inst78000088, bindings: inst_block78000034, self_specific_id: specific78000004, decl_block_id: inst_block78000036, definition_block_id: inst_block78000038} -// CHECK:STDOUT: generic78000004: {decl: inst78000090, bindings: inst_block7800002B, self_specific_id: specific78000007, decl_block_id: inst_block7800002C, definition_block_id: inst_block78000031} -// CHECK:STDOUT: generic78000005: {decl: inst780000EF, bindings: inst_block7800003C, self_specific_id: specific7800000B, decl_block_id: inst_block7800003E, definition_block_id: inst_block78000045} -// CHECK:STDOUT: generic78000006: {decl: inst780000FE, bindings: inst_block78000041, self_specific_id: specific7800000D, decl_block_id: inst_block78000042, definition_block_id: inst_block_empty} -// CHECK:STDOUT: generic78000007: {decl: inst7800012C, bindings: inst_block7800005B, self_specific_id: specific7800000E, decl_block_id: inst_block7800005F, definition_block_id: inst_block78000061} -// CHECK:STDOUT: generic78000008: {decl: inst78000134, bindings: inst_block7800004E, self_specific_id: specific78000011, decl_block_id: inst_block78000050, definition_block_id: inst_block78000058} -// CHECK:STDOUT: generic78000009: {decl: inst7800018B, bindings: inst_block78000079, self_specific_id: specific78000017, decl_block_id: inst_block7800007D, definition_block_id: inst_block7800007F} -// CHECK:STDOUT: generic7800000A: {decl: inst78000193, bindings: inst_block7800006A, self_specific_id: specific7800001A, decl_block_id: inst_block7800006C, definition_block_id: inst_block78000076} +// CHECK:STDOUT: generic78000000: {decl: inst78000047, bindings: inst_block78000015, self_specific_id: specific78000000, decl_block_id: inst_block78000017, definition_block_id: inst_block7800008C} +// CHECK:STDOUT: generic78000001: {decl: inst7800005A, bindings: inst_block7800001C, self_specific_id: specific78000001, decl_block_id: inst_block_empty, definition_block_id: inst_block78000025} +// CHECK:STDOUT: generic78000002: {decl: inst7800005F, bindings: inst_block78000021, self_specific_id: specific78000002, decl_block_id: inst_block78000022, definition_block_id: inst_block} +// CHECK:STDOUT: generic78000003: {decl: inst78000088, bindings: inst_block78000035, self_specific_id: specific78000004, decl_block_id: inst_block78000037, definition_block_id: inst_block78000039} +// CHECK:STDOUT: generic78000004: {decl: inst78000090, bindings: inst_block7800002C, self_specific_id: specific78000007, decl_block_id: inst_block7800002D, definition_block_id: inst_block78000032} +// CHECK:STDOUT: generic78000005: {decl: inst780000EF, bindings: inst_block7800003D, self_specific_id: specific7800000B, decl_block_id: inst_block7800003F, definition_block_id: inst_block78000046} +// CHECK:STDOUT: generic78000006: {decl: inst780000FE, bindings: inst_block78000042, self_specific_id: specific7800000D, decl_block_id: inst_block78000043, definition_block_id: inst_block_empty} +// CHECK:STDOUT: generic78000007: {decl: inst7800012C, bindings: inst_block7800005C, self_specific_id: specific7800000E, decl_block_id: inst_block78000060, definition_block_id: inst_block78000062} +// CHECK:STDOUT: generic78000008: {decl: inst78000134, bindings: inst_block7800004F, self_specific_id: specific78000011, decl_block_id: inst_block78000051, definition_block_id: inst_block78000059} +// CHECK:STDOUT: generic78000009: {decl: inst7800018B, bindings: inst_block7800007A, self_specific_id: specific78000017, decl_block_id: inst_block7800007E, definition_block_id: inst_block78000080} +// CHECK:STDOUT: generic7800000A: {decl: inst78000193, bindings: inst_block7800006B, self_specific_id: specific7800001A, decl_block_id: inst_block7800006D, definition_block_id: inst_block78000077} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific78000000: {generic: generic78000000, args: inst_block78000015, identified: 0, decl_block_id: inst_block78000017, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000001: {generic: generic78000001, args: inst_block7800001C, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800001D, definition_has_error: 0} -// CHECK:STDOUT: specific78000002: {generic: generic78000002, args: inst_block7800001C, identified: 0, decl_block_id: inst_block78000022, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000003: {generic: generic78000001, args: inst_block78000023, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000004: {generic: generic78000003, args: inst_block78000026, identified: 0, decl_block_id: inst_block78000027, decl_has_error: 0, definition_block_id: inst_block78000028, definition_has_error: 0} -// CHECK:STDOUT: specific78000005: {generic: generic78000001, args: inst_block78000026, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800002D, definition_has_error: 0} -// CHECK:STDOUT: specific78000006: {generic: generic78000002, args: inst_block78000026, identified: 0, decl_block_id: inst_block7800002E, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000007: {generic: generic78000004, args: inst_block78000026, identified: 0, decl_block_id: inst_block78000032, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000008: {generic: generic78000001, args: inst_block7800002F, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000009: {generic: generic78000002, args: inst_block7800002F, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800000A: {generic: generic78000003, args: inst_block78000035, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800000B: {generic: generic78000005, args: inst_block78000015, identified: 0, decl_block_id: inst_block7800003A, decl_has_error: 0, definition_block_id: inst_block78000080, definition_has_error: 0} -// CHECK:STDOUT: specific7800000C: {generic: generic78000005, args: inst_block7800003D, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800000D: {generic: generic78000006, args: inst_block78000015, identified: 0, decl_block_id: inst_block78000043, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800000E: {generic: generic78000007, args: inst_block78000048, identified: 0, decl_block_id: inst_block7800004A, decl_has_error: 0, definition_block_id: inst_block7800004B, definition_has_error: 0} -// CHECK:STDOUT: specific7800000F: {generic: generic78000001, args: inst_block78000051, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block78000052, definition_has_error: 0} -// CHECK:STDOUT: specific78000010: {generic: generic78000002, args: inst_block78000051, identified: 0, decl_block_id: inst_block78000053, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000011: {generic: generic78000008, args: inst_block78000048, identified: 0, decl_block_id: inst_block78000059, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000012: {generic: generic78000001, args: inst_block78000054, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000013: {generic: generic78000002, args: inst_block78000054, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000014: {generic: generic78000001, args: inst_block78000056, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000015: {generic: generic78000002, args: inst_block78000056, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000016: {generic: generic78000007, args: inst_block7800005C, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000017: {generic: generic78000009, args: inst_block78000064, identified: 0, decl_block_id: inst_block78000066, decl_has_error: 0, definition_block_id: inst_block78000067, definition_has_error: 0} -// CHECK:STDOUT: specific78000018: {generic: generic78000001, args: inst_block7800006D, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800006E, definition_has_error: 0} -// CHECK:STDOUT: specific78000019: {generic: generic78000002, args: inst_block7800006D, identified: 0, decl_block_id: inst_block7800006F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001A: {generic: generic7800000A, args: inst_block78000064, identified: 0, decl_block_id: inst_block78000077, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001B: {generic: generic78000001, args: inst_block78000070, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001C: {generic: generic78000002, args: inst_block78000070, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001D: {generic: generic78000001, args: inst_block78000072, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001E: {generic: generic78000002, args: inst_block78000072, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific7800001F: {generic: generic78000001, args: inst_block78000074, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000020: {generic: generic78000002, args: inst_block78000074, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000021: {generic: generic78000009, args: inst_block7800007A, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000022: {generic: generic78000005, args: inst_block78000081, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000023: {generic: generic78000001, args: inst_block78000083, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block78000084, definition_has_error: 0} -// CHECK:STDOUT: specific78000024: {generic: generic78000001, args: inst_block78000086, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000025: {generic: generic78000002, args: inst_block78000083, identified: 0, decl_block_id: inst_block78000087, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} -// CHECK:STDOUT: specific78000026: {generic: generic78000002, args: inst_block78000086, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000000: {generic: generic78000000, args: inst_block78000016, identified: 0, decl_block_id: inst_block78000018, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000001: {generic: generic78000001, args: inst_block7800001D, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800001E, definition_has_error: 0} +// CHECK:STDOUT: specific78000002: {generic: generic78000002, args: inst_block7800001D, identified: 0, decl_block_id: inst_block78000023, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000003: {generic: generic78000001, args: inst_block78000024, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000004: {generic: generic78000003, args: inst_block78000027, identified: 0, decl_block_id: inst_block78000028, decl_has_error: 0, definition_block_id: inst_block78000029, definition_has_error: 0} +// CHECK:STDOUT: specific78000005: {generic: generic78000001, args: inst_block78000027, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800002E, definition_has_error: 0} +// CHECK:STDOUT: specific78000006: {generic: generic78000002, args: inst_block78000027, identified: 0, decl_block_id: inst_block7800002F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000007: {generic: generic78000004, args: inst_block78000027, identified: 0, decl_block_id: inst_block78000033, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000008: {generic: generic78000001, args: inst_block78000030, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000009: {generic: generic78000002, args: inst_block78000030, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800000A: {generic: generic78000003, args: inst_block78000036, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800000B: {generic: generic78000005, args: inst_block78000016, identified: 0, decl_block_id: inst_block7800003B, decl_has_error: 0, definition_block_id: inst_block78000081, definition_has_error: 0} +// CHECK:STDOUT: specific7800000C: {generic: generic78000005, args: inst_block7800003E, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800000D: {generic: generic78000006, args: inst_block78000016, identified: 0, decl_block_id: inst_block78000044, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800000E: {generic: generic78000007, args: inst_block78000049, identified: 0, decl_block_id: inst_block7800004B, decl_has_error: 0, definition_block_id: inst_block7800004C, definition_has_error: 0} +// CHECK:STDOUT: specific7800000F: {generic: generic78000001, args: inst_block78000052, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block78000053, definition_has_error: 0} +// CHECK:STDOUT: specific78000010: {generic: generic78000002, args: inst_block78000052, identified: 0, decl_block_id: inst_block78000054, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000011: {generic: generic78000008, args: inst_block78000049, identified: 0, decl_block_id: inst_block7800005A, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000012: {generic: generic78000001, args: inst_block78000055, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000013: {generic: generic78000002, args: inst_block78000055, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000014: {generic: generic78000001, args: inst_block78000057, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000015: {generic: generic78000002, args: inst_block78000057, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000016: {generic: generic78000007, args: inst_block7800005D, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000017: {generic: generic78000009, args: inst_block78000065, identified: 0, decl_block_id: inst_block78000067, decl_has_error: 0, definition_block_id: inst_block78000068, definition_has_error: 0} +// CHECK:STDOUT: specific78000018: {generic: generic78000001, args: inst_block7800006E, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block7800006F, definition_has_error: 0} +// CHECK:STDOUT: specific78000019: {generic: generic78000002, args: inst_block7800006E, identified: 0, decl_block_id: inst_block78000070, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001A: {generic: generic7800000A, args: inst_block78000065, identified: 0, decl_block_id: inst_block78000078, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001B: {generic: generic78000001, args: inst_block78000071, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001C: {generic: generic78000002, args: inst_block78000071, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001D: {generic: generic78000001, args: inst_block78000073, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001E: {generic: generic78000002, args: inst_block78000073, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific7800001F: {generic: generic78000001, args: inst_block78000075, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000020: {generic: generic78000002, args: inst_block78000075, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000021: {generic: generic78000009, args: inst_block7800007B, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000022: {generic: generic78000005, args: inst_block78000082, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000023: {generic: generic78000001, args: inst_block78000084, identified: 0, decl_block_id: inst_block_empty, decl_has_error: 0, definition_block_id: inst_block78000085, definition_has_error: 0} +// CHECK:STDOUT: specific78000024: {generic: generic78000001, args: inst_block78000087, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000025: {generic: generic78000002, args: inst_block78000084, identified: 0, decl_block_id: inst_block78000088, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific78000026: {generic: generic78000002, args: inst_block78000087, identified: 0, decl_block_id: inst_block, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} // CHECK:STDOUT: specific_interfaces: // CHECK:STDOUT: specific_interface78000000: {interface_id: interface78000000, specific_id: specific} // CHECK:STDOUT: struct_type_fields: @@ -604,15 +604,15 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800002B: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst7800002C: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst7800002B)} // CHECK:STDOUT: inst7800002D: {kind: TupleValue, arg0: inst_block_empty, type: type(inst7800002B)} -// CHECK:STDOUT: inst7800002E: {kind: TupleType, arg0: inst_block7800000A, type: type(TypeType)} -// CHECK:STDOUT: inst7800002F: {kind: TupleLiteral, arg0: inst_block78000009, type: type(inst7800002E)} -// CHECK:STDOUT: inst78000030: {kind: TupleValue, arg0: inst_block7800000B, type: type(inst7800002E)} -// CHECK:STDOUT: inst78000031: {kind: TupleValue, arg0: inst_block7800000C, type: type(inst7800002E)} +// CHECK:STDOUT: inst7800002E: {kind: TupleType, arg0: inst_block7800000B, type: type(TypeType)} +// CHECK:STDOUT: inst7800002F: {kind: TupleLiteral, arg0: inst_block7800000A, type: type(inst7800002E)} +// CHECK:STDOUT: inst78000030: {kind: TupleValue, arg0: inst_block7800000C, type: type(inst7800002E)} +// CHECK:STDOUT: inst78000031: {kind: TupleValue, arg0: inst_block7800000D, type: type(inst7800002E)} // CHECK:STDOUT: inst78000032: {kind: PointerType, arg0: inst7800002E, type: type(TypeType)} // CHECK:STDOUT: inst78000033: {kind: Converted, arg0: inst7800002D, arg1: inst7800002B, type: type(TypeType)} -// CHECK:STDOUT: inst78000034: {kind: TupleType, arg0: inst_block7800000E, type: type(TypeType)} +// CHECK:STDOUT: inst78000034: {kind: TupleType, arg0: inst_block7800000F, type: type(TypeType)} // CHECK:STDOUT: inst78000035: {kind: Converted, arg0: inst7800002F, arg1: inst78000034, type: type(TypeType)} -// CHECK:STDOUT: inst78000036: {kind: TupleType, arg0: inst_block7800000F, type: type(TypeType)} +// CHECK:STDOUT: inst78000036: {kind: TupleType, arg0: inst_block78000010, type: type(TypeType)} // CHECK:STDOUT: inst78000037: {kind: InitForm, arg0: inst78000035, type: type(inst(FormType))} // CHECK:STDOUT: inst78000038: {kind: InitForm, arg0: inst78000034, type: type(inst(FormType))} // CHECK:STDOUT: inst78000039: {kind: InitForm, arg0: inst78000036, type: type(inst(FormType))} @@ -624,12 +624,12 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800003F: {kind: ReturnSlotPattern, arg0: inst7800003B, arg1: inst78000035, type: type(symbolic_constant78000015)} // CHECK:STDOUT: inst78000040: {kind: ReturnSlotPattern, arg0: inst7800003C, arg1: inst78000034, type: type(symbolic_constant78000013)} // CHECK:STDOUT: inst78000041: {kind: ReturnSlotPattern, arg0: inst7800003E, arg1: inst78000036, type: type(symbolic_constant78000015)} -// CHECK:STDOUT: inst78000042: {kind: SpliceBlock, arg0: inst_block78000005, arg1: inst78000014, type: type(TypeType)} +// CHECK:STDOUT: inst78000042: {kind: SpliceBlock, arg0: inst_block78000006, arg1: inst78000014, type: type(TypeType)} // CHECK:STDOUT: inst78000043: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(symbolic_constant78000006)} -// CHECK:STDOUT: inst78000044: {kind: SpliceBlock, arg0: inst_block78000007, arg1: inst7800001D, type: type(TypeType)} +// CHECK:STDOUT: inst78000044: {kind: SpliceBlock, arg0: inst_block78000008, arg1: inst7800001D, type: type(TypeType)} // CHECK:STDOUT: inst78000045: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constant78000010)} // CHECK:STDOUT: inst78000046: {kind: ReturnSlot, arg0: inst78000034, arg1: inst78000045, type: type(symbolic_constant78000010)} -// CHECK:STDOUT: inst78000047: {kind: FunctionDecl, arg0: function78000000, arg1: inst_block78000013, type: type(inst78000048)} +// CHECK:STDOUT: inst78000047: {kind: FunctionDecl, arg0: function78000000, arg1: inst_block78000014, type: type(inst78000048)} // CHECK:STDOUT: inst78000048: {kind: FunctionType, arg0: function78000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst78000049: {kind: StructValue, arg0: inst_block_empty, type: type(inst78000048)} // CHECK:STDOUT: inst7800004A: {kind: RequireCompleteType, arg0: inst7800001E, type: type(inst(WitnessType))} @@ -641,7 +641,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst78000050: {kind: RequireCompleteType, arg0: inst78000036, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000051: {kind: NameRef, arg0: name2, arg1: inst78000028, type: type(symbolic_constant78000006)} // CHECK:STDOUT: inst78000052: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst7800002B)} -// CHECK:STDOUT: inst78000053: {kind: TupleLiteral, arg0: inst_block78000019, type: type(symbolic_constant78000010)} +// CHECK:STDOUT: inst78000053: {kind: TupleLiteral, arg0: inst_block7800001A, type: type(symbolic_constant78000010)} // CHECK:STDOUT: inst78000054: {kind: RequireCompleteType, arg0: inst78000034, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000055: {kind: TupleAccess, arg0: inst78000045, arg1: element0, type: type(symbolic_constant78000006)} // CHECK:STDOUT: inst78000056: {kind: RequireCompleteType, arg0: inst7800001E, type: type(inst(WitnessType))} @@ -700,7 +700,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800008B: {kind: ConstType, arg0: inst7800008A, type: type(TypeType)} // CHECK:STDOUT: inst7800008C: {kind: ImplSelfWitness, arg0: inst7800008B, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst7800008D: {kind: ImportRefUnloaded, arg0: import_ir_inst1A, arg1: entity_name} -// CHECK:STDOUT: inst7800008E: {kind: ImplWitnessTable, arg0: inst_block78000025, arg1: impl78000000} +// CHECK:STDOUT: inst7800008E: {kind: ImplWitnessTable, arg0: inst_block78000026, arg1: impl78000000} // CHECK:STDOUT: inst7800008F: {kind: ImplWitness, arg0: inst7800008E, arg1: specific78000004, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000090: {kind: FunctionDecl, arg0: function78000002, arg1: inst_block_empty, type: type(symbolic_constant7800004D)} // CHECK:STDOUT: inst78000091: {kind: FunctionType, arg0: function78000002, arg1: specific78000004, type: type(TypeType)} @@ -800,7 +800,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst780000EF: {kind: ImplDecl, arg0: impl78000005, arg1: inst_block_empty} // CHECK:STDOUT: inst780000F0: {kind: ImplSelfWitness, arg0: inst7800001E, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst780000F1: {kind: ImportRefUnloaded, arg0: import_ir_inst59, arg1: entity_name} -// CHECK:STDOUT: inst780000F2: {kind: ImplWitnessTable, arg0: inst_block78000039, arg1: impl78000005} +// CHECK:STDOUT: inst780000F2: {kind: ImplWitnessTable, arg0: inst_block7800003A, arg1: impl78000005} // CHECK:STDOUT: inst780000F3: {kind: ImplWitness, arg0: inst780000F2, arg1: specific7800000B, type: type(inst(WitnessType))} // CHECK:STDOUT: inst780000F4: {kind: ImportRefLoaded, arg0: import_ir_inst5B, arg1: entity_name, type: type(inst78000015)} // CHECK:STDOUT: inst780000F5: {kind: ImportRefLoaded, arg0: import_ir_inst5C, arg1: entity_name, type: type(TypeType)} @@ -861,18 +861,18 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800012C: {kind: ImplDecl, arg0: impl78000008, arg1: inst_block_empty} // CHECK:STDOUT: inst7800012D: {kind: SymbolicBinding, arg0: entity_name78000021, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst7800012E: {kind: FacetAccessType, arg0: inst7800012D, type: type(TypeType)} -// CHECK:STDOUT: inst7800012F: {kind: TupleType, arg0: inst_block78000046, type: type(TypeType)} +// CHECK:STDOUT: inst7800012F: {kind: TupleType, arg0: inst_block78000047, type: type(TypeType)} // CHECK:STDOUT: inst78000130: {kind: ImplSelfWitness, arg0: inst7800012F, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000131: {kind: ImportRefUnloaded, arg0: import_ir_inst84, arg1: entity_name} -// CHECK:STDOUT: inst78000132: {kind: ImplWitnessTable, arg0: inst_block78000047, arg1: impl78000008} +// CHECK:STDOUT: inst78000132: {kind: ImplWitnessTable, arg0: inst_block78000048, arg1: impl78000008} // CHECK:STDOUT: inst78000133: {kind: ImplWitness, arg0: inst78000132, arg1: specific7800000E, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000134: {kind: FunctionDecl, arg0: function78000004, arg1: inst_block_empty, type: type(symbolic_constant780000D8)} // CHECK:STDOUT: inst78000135: {kind: FunctionType, arg0: function78000004, arg1: specific7800000E, type: type(TypeType)} // CHECK:STDOUT: inst78000136: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant780000D8)} // CHECK:STDOUT: inst78000137: {kind: PatternType, arg0: inst7800012F, type: type(TypeType)} // CHECK:STDOUT: inst78000138: {kind: OutParamPattern, arg0: name(ReturnSlot), type: type(symbolic_constant780000DB)} -// CHECK:STDOUT: inst78000139: {kind: TupleType, arg0: inst_block78000049, type: type(TypeType)} -// CHECK:STDOUT: inst7800013A: {kind: TupleValue, arg0: inst_block78000048, type: type(inst78000139)} +// CHECK:STDOUT: inst78000139: {kind: TupleType, arg0: inst_block7800004A, type: type(TypeType)} +// CHECK:STDOUT: inst7800013A: {kind: TupleValue, arg0: inst_block78000049, type: type(inst78000139)} // CHECK:STDOUT: inst7800013B: {kind: SymbolicBindingPattern, arg0: entity_name78000021, type: type(inst78000095)} // CHECK:STDOUT: inst7800013C: {kind: ImportRefLoaded, arg0: import_ir_inst86, arg1: entity_name, type: type(symbolic_constant780000DB)} // CHECK:STDOUT: inst7800013D: {kind: ReturnSlotPattern, arg0: inst78000138, arg1: inst, type: type(symbolic_constant780000DB)} @@ -895,7 +895,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800014E: {kind: FacetAccessType, arg0: inst7800014D, type: type(TypeType)} // CHECK:STDOUT: inst7800014F: {kind: SymbolicBinding, arg0: entity_name78000021, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst78000150: {kind: FacetAccessType, arg0: inst7800014F, type: type(TypeType)} -// CHECK:STDOUT: inst78000151: {kind: TupleType, arg0: inst_block7800004F, type: type(TypeType)} +// CHECK:STDOUT: inst78000151: {kind: TupleType, arg0: inst_block78000050, type: type(TypeType)} // CHECK:STDOUT: inst78000152: {kind: PatternType, arg0: inst78000151, type: type(TypeType)} // CHECK:STDOUT: inst78000153: {kind: ValueParamPattern, arg0: name(SelfValue), type: type(symbolic_constant780000FC)} // CHECK:STDOUT: inst78000154: {kind: WrapperBindingPattern, arg0: entity_name78000007, arg1: inst78000153, type: type(symbolic_constant780000FC)} @@ -944,10 +944,10 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800017F: {kind: SymbolicBinding, arg0: entity_name78000001, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst78000180: {kind: SymbolicBindingPattern, arg0: entity_name78000021, type: type(inst78000095)} // CHECK:STDOUT: inst78000181: {kind: SymbolicBinding, arg0: entity_name78000021, arg1: inst, type: type(inst78000059)} -// CHECK:STDOUT: inst78000182: {kind: TupleValue, arg0: inst_block7800005C, type: type(inst78000139)} +// CHECK:STDOUT: inst78000182: {kind: TupleValue, arg0: inst_block7800005D, type: type(inst78000139)} // CHECK:STDOUT: inst78000183: {kind: FacetAccessType, arg0: inst7800017F, type: type(TypeType)} // CHECK:STDOUT: inst78000184: {kind: FacetAccessType, arg0: inst78000181, type: type(TypeType)} -// CHECK:STDOUT: inst78000185: {kind: TupleType, arg0: inst_block7800005D, type: type(TypeType)} +// CHECK:STDOUT: inst78000185: {kind: TupleType, arg0: inst_block7800005E, type: type(TypeType)} // CHECK:STDOUT: inst78000186: {kind: ImplSelfWitness, arg0: inst78000185, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000187: {kind: ImplWitness, arg0: inst78000132, arg1: specific78000016, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000188: {kind: FunctionType, arg0: function78000004, arg1: specific78000016, type: type(TypeType)} @@ -956,18 +956,18 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800018B: {kind: ImplDecl, arg0: impl78000009, arg1: inst_block_empty} // CHECK:STDOUT: inst7800018C: {kind: SymbolicBinding, arg0: entity_name78000031, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst7800018D: {kind: FacetAccessType, arg0: inst7800018C, type: type(TypeType)} -// CHECK:STDOUT: inst7800018E: {kind: TupleType, arg0: inst_block78000062, type: type(TypeType)} +// CHECK:STDOUT: inst7800018E: {kind: TupleType, arg0: inst_block78000063, type: type(TypeType)} // CHECK:STDOUT: inst7800018F: {kind: ImplSelfWitness, arg0: inst7800018E, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000190: {kind: ImportRefUnloaded, arg0: import_ir_instBD, arg1: entity_name} -// CHECK:STDOUT: inst78000191: {kind: ImplWitnessTable, arg0: inst_block78000063, arg1: impl78000009} +// CHECK:STDOUT: inst78000191: {kind: ImplWitnessTable, arg0: inst_block78000064, arg1: impl78000009} // CHECK:STDOUT: inst78000192: {kind: ImplWitness, arg0: inst78000191, arg1: specific78000017, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000193: {kind: FunctionDecl, arg0: function78000005, arg1: inst_block_empty, type: type(symbolic_constant7800014A)} // CHECK:STDOUT: inst78000194: {kind: FunctionType, arg0: function78000005, arg1: specific78000017, type: type(TypeType)} // CHECK:STDOUT: inst78000195: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant7800014A)} // CHECK:STDOUT: inst78000196: {kind: PatternType, arg0: inst7800018E, type: type(TypeType)} // CHECK:STDOUT: inst78000197: {kind: OutParamPattern, arg0: name(ReturnSlot), type: type(symbolic_constant7800014D)} -// CHECK:STDOUT: inst78000198: {kind: TupleType, arg0: inst_block78000065, type: type(TypeType)} -// CHECK:STDOUT: inst78000199: {kind: TupleValue, arg0: inst_block78000064, type: type(inst78000198)} +// CHECK:STDOUT: inst78000198: {kind: TupleType, arg0: inst_block78000066, type: type(TypeType)} +// CHECK:STDOUT: inst78000199: {kind: TupleValue, arg0: inst_block78000065, type: type(inst78000198)} // CHECK:STDOUT: inst7800019A: {kind: SymbolicBindingPattern, arg0: entity_name78000031, type: type(inst78000095)} // CHECK:STDOUT: inst7800019B: {kind: ImportRefLoaded, arg0: import_ir_instBF, arg1: entity_name, type: type(symbolic_constant7800014D)} // CHECK:STDOUT: inst7800019C: {kind: ReturnSlotPattern, arg0: inst78000197, arg1: inst, type: type(symbolic_constant7800014D)} @@ -993,7 +993,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst780001B0: {kind: FacetAccessType, arg0: inst780001AF, type: type(TypeType)} // CHECK:STDOUT: inst780001B1: {kind: SymbolicBinding, arg0: entity_name78000031, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst780001B2: {kind: FacetAccessType, arg0: inst780001B1, type: type(TypeType)} -// CHECK:STDOUT: inst780001B3: {kind: TupleType, arg0: inst_block7800006B, type: type(TypeType)} +// CHECK:STDOUT: inst780001B3: {kind: TupleType, arg0: inst_block7800006C, type: type(TypeType)} // CHECK:STDOUT: inst780001B4: {kind: PatternType, arg0: inst780001B3, type: type(TypeType)} // CHECK:STDOUT: inst780001B5: {kind: ValueParamPattern, arg0: name(SelfValue), type: type(symbolic_constant78000173)} // CHECK:STDOUT: inst780001B6: {kind: WrapperBindingPattern, arg0: entity_name78000007, arg1: inst780001B5, type: type(symbolic_constant78000173)} @@ -1052,11 +1052,11 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst780001EB: {kind: SymbolicBinding, arg0: entity_name78000021, arg1: inst, type: type(inst78000059)} // CHECK:STDOUT: inst780001EC: {kind: SymbolicBindingPattern, arg0: entity_name78000031, type: type(inst78000095)} // CHECK:STDOUT: inst780001ED: {kind: SymbolicBinding, arg0: entity_name78000031, arg1: inst, type: type(inst78000059)} -// CHECK:STDOUT: inst780001EE: {kind: TupleValue, arg0: inst_block7800007A, type: type(inst78000198)} +// CHECK:STDOUT: inst780001EE: {kind: TupleValue, arg0: inst_block7800007B, type: type(inst78000198)} // CHECK:STDOUT: inst780001EF: {kind: FacetAccessType, arg0: inst780001E9, type: type(TypeType)} // CHECK:STDOUT: inst780001F0: {kind: FacetAccessType, arg0: inst780001EB, type: type(TypeType)} // CHECK:STDOUT: inst780001F1: {kind: FacetAccessType, arg0: inst780001ED, type: type(TypeType)} -// CHECK:STDOUT: inst780001F2: {kind: TupleType, arg0: inst_block7800007B, type: type(TypeType)} +// CHECK:STDOUT: inst780001F2: {kind: TupleType, arg0: inst_block7800007C, type: type(TypeType)} // CHECK:STDOUT: inst780001F3: {kind: ImplSelfWitness, arg0: inst780001F2, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst780001F4: {kind: ImplWitness, arg0: inst78000191, arg1: specific78000021, type: type(inst(WitnessType))} // CHECK:STDOUT: inst780001F5: {kind: FunctionType, arg0: function78000005, arg1: specific78000021, type: type(TypeType)} @@ -1065,37 +1065,37 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst780001F8: {kind: RequireSpecificDefinition, arg0: specific7800000B, type: type(inst(RequireSpecificDefinitionType))} // CHECK:STDOUT: inst780001F9: {kind: RequireSpecificDefinition, arg0: specific7800000B, type: type(inst(RequireSpecificDefinitionType))} // CHECK:STDOUT: inst780001FA: {kind: RequireSpecificDefinition, arg0: specific78000022, type: type(inst(RequireSpecificDefinitionType))} -// CHECK:STDOUT: inst780001FB: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000082, type: type(inst78000059)} +// CHECK:STDOUT: inst780001FB: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000083, type: type(inst78000059)} // CHECK:STDOUT: inst780001FC: {kind: FunctionType, arg0: function78000001, arg1: specific78000023, type: type(TypeType)} // CHECK:STDOUT: inst780001FD: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant780001D1)} // CHECK:STDOUT: inst780001FE: {kind: FunctionTypeWithSelfType, arg0: inst780001FC, arg1: inst780001FB, type: type(TypeType)} // CHECK:STDOUT: inst780001FF: {kind: ImplWitnessAccess, arg0: inst780001F7, arg1: element0, type: type(symbolic_constant780001D8)} // CHECK:STDOUT: inst78000200: {kind: ImplWitnessAccess, arg0: inst780001F7, arg1: element0, type: type(symbolic_constant780001D3)} // CHECK:STDOUT: inst78000201: {kind: LookupImplWitness, arg0: inst7800001F, arg1: specific_interface78000000, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst78000202: {kind: FacetValue, arg0: inst7800001F, arg1: inst_block78000085, type: type(inst78000059)} +// CHECK:STDOUT: inst78000202: {kind: FacetValue, arg0: inst7800001F, arg1: inst_block78000086, type: type(inst78000059)} // CHECK:STDOUT: inst78000203: {kind: FunctionType, arg0: function78000001, arg1: specific78000024, type: type(TypeType)} // CHECK:STDOUT: inst78000204: {kind: FunctionTypeWithSelfType, arg0: inst78000203, arg1: inst78000202, type: type(TypeType)} // CHECK:STDOUT: inst78000205: {kind: ImplWitnessAccess, arg0: inst78000201, arg1: element0, type: type(symbolic_constant780001D8)} // CHECK:STDOUT: inst78000206: {kind: BoundMethod, arg0: inst78000051, arg1: inst780001FF, type: type(inst(BoundMethodType))} // CHECK:STDOUT: inst78000207: {kind: LookupImplWitness, arg0: inst7800001E, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst78000208: {kind: RequireSpecificDefinition, arg0: specific7800000B, type: type(inst(RequireSpecificDefinitionType))} -// CHECK:STDOUT: inst78000209: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000082, type: type(inst78000059)} +// CHECK:STDOUT: inst78000209: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000083, type: type(inst78000059)} // CHECK:STDOUT: inst7800020A: {kind: Converted, arg0: inst7800001E, arg1: inst78000209, type: type(inst78000059)} // CHECK:STDOUT: inst7800020B: {kind: LookupImplWitness, arg0: inst7800001E, arg1: specific_interface78000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst7800020C: {kind: RequireSpecificDefinition, arg0: specific7800000B, type: type(inst(RequireSpecificDefinitionType))} -// CHECK:STDOUT: inst7800020D: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000082, type: type(inst78000059)} +// CHECK:STDOUT: inst7800020D: {kind: FacetValue, arg0: inst7800001E, arg1: inst_block78000083, type: type(inst78000059)} // CHECK:STDOUT: inst7800020E: {kind: Converted, arg0: inst7800001E, arg1: inst7800020D, type: type(inst78000059)} // CHECK:STDOUT: inst7800020F: {kind: SpecificImplFunction, arg0: inst780001FF, arg1: specific78000025, type: type(inst(SpecificFunctionType))} // CHECK:STDOUT: inst78000210: {kind: SpecificImplFunction, arg0: inst78000200, arg1: specific78000025, type: type(inst(SpecificFunctionType))} // CHECK:STDOUT: inst78000211: {kind: SpecificImplFunction, arg0: inst78000205, arg1: specific78000026, type: type(inst(SpecificFunctionType))} // CHECK:STDOUT: inst78000212: {kind: BoundMethod, arg0: inst78000051, arg1: inst7800020F, type: type(inst(BoundMethodType))} -// CHECK:STDOUT: inst78000213: {kind: Call, arg0: inst78000212, arg1: inst_block78000089, type: type(symbolic_constant78000006)} +// CHECK:STDOUT: inst78000213: {kind: Call, arg0: inst78000212, arg1: inst_block7800008A, type: type(symbolic_constant78000006)} // CHECK:STDOUT: inst78000214: {kind: InPlaceInit, arg0: inst78000213, arg1: inst78000055, type: type(symbolic_constant78000006)} // CHECK:STDOUT: inst78000215: {kind: TupleAccess, arg0: inst78000045, arg1: element1, type: type(inst7800002B)} // CHECK:STDOUT: inst78000216: {kind: TupleInit, arg0: inst_block_empty, arg1: inst78000215, type: type(inst7800002B)} // CHECK:STDOUT: inst78000217: {kind: Converted, arg0: inst78000052, arg1: inst78000216, type: type(inst7800002B)} // CHECK:STDOUT: inst78000218: {kind: InPlaceInit, arg0: inst78000217, arg1: inst78000215, type: type(inst7800002B)} -// CHECK:STDOUT: inst78000219: {kind: TupleInit, arg0: inst_block7800008A, arg1: inst78000045, type: type(symbolic_constant78000010)} +// CHECK:STDOUT: inst78000219: {kind: TupleInit, arg0: inst_block7800008B, arg1: inst78000045, type: type(symbolic_constant78000010)} // CHECK:STDOUT: inst7800021A: {kind: Converted, arg0: inst78000053, arg1: inst78000219, type: type(symbolic_constant78000010)} // CHECK:STDOUT: inst7800021B: {kind: ReturnExpr, arg0: inst7800021A, arg1: inst78000045} // CHECK:STDOUT: bundles: {} @@ -2257,50 +2257,51 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 163: inst780001E6 // CHECK:STDOUT: 164: inst780001E7 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block78000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block78000006: // CHECK:STDOUT: 0: inst78000012 // CHECK:STDOUT: 1: inst78000014 -// CHECK:STDOUT: inst_block78000006: -// CHECK:STDOUT: 0: inst78000016 // CHECK:STDOUT: inst_block78000007: +// CHECK:STDOUT: 0: inst78000016 +// CHECK:STDOUT: inst_block78000008: // CHECK:STDOUT: 0: inst7800001C // CHECK:STDOUT: 1: inst7800001D -// CHECK:STDOUT: inst_block78000008: -// CHECK:STDOUT: 0: inst78000025 // CHECK:STDOUT: inst_block78000009: +// CHECK:STDOUT: 0: inst78000025 +// CHECK:STDOUT: inst_block7800000A: // CHECK:STDOUT: 0: inst7800002A // CHECK:STDOUT: 1: inst7800002C -// CHECK:STDOUT: inst_block7800000A: +// CHECK:STDOUT: inst_block7800000B: // CHECK:STDOUT: 0: inst(TypeType) // CHECK:STDOUT: 1: inst7800002B -// CHECK:STDOUT: inst_block7800000B: -// CHECK:STDOUT: 0: inst7800001E -// CHECK:STDOUT: 1: inst7800002D // CHECK:STDOUT: inst_block7800000C: -// CHECK:STDOUT: 0: inst7800001F +// CHECK:STDOUT: 0: inst7800001E // CHECK:STDOUT: 1: inst7800002D // CHECK:STDOUT: inst_block7800000D: -// CHECK:STDOUT: 0: inst7800001E -// CHECK:STDOUT: 1: inst78000033 +// CHECK:STDOUT: 0: inst7800001F +// CHECK:STDOUT: 1: inst7800002D // CHECK:STDOUT: inst_block7800000E: // CHECK:STDOUT: 0: inst7800001E -// CHECK:STDOUT: 1: inst7800002B +// CHECK:STDOUT: 1: inst78000033 // CHECK:STDOUT: inst_block7800000F: -// CHECK:STDOUT: 0: inst7800001F +// CHECK:STDOUT: 0: inst7800001E // CHECK:STDOUT: 1: inst7800002B // CHECK:STDOUT: inst_block78000010: +// CHECK:STDOUT: 0: inst7800001F +// CHECK:STDOUT: 1: inst7800002B +// CHECK:STDOUT: inst_block78000011: // CHECK:STDOUT: 0: inst78000021 // CHECK:STDOUT: 1: inst7800003B -// CHECK:STDOUT: inst_block78000011: +// CHECK:STDOUT: inst_block78000012: // CHECK:STDOUT: 0: inst78000043 // CHECK:STDOUT: 1: inst78000045 -// CHECK:STDOUT: inst_block78000012: +// CHECK:STDOUT: inst_block78000013: // CHECK:STDOUT: 0: inst78000016 // CHECK:STDOUT: 1: inst78000021 // CHECK:STDOUT: 2: inst78000025 // CHECK:STDOUT: 3: inst7800003B // CHECK:STDOUT: 4: inst7800003F -// CHECK:STDOUT: inst_block78000013: +// CHECK:STDOUT: inst_block78000014: // CHECK:STDOUT: 0: inst78000029 // CHECK:STDOUT: 1: inst7800002A // CHECK:STDOUT: 2: inst7800002C @@ -2315,11 +2316,11 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 11: inst78000028 // CHECK:STDOUT: 12: inst78000045 // CHECK:STDOUT: 13: inst78000046 -// CHECK:STDOUT: inst_block78000014: -// CHECK:STDOUT: 0: inst78000019 // CHECK:STDOUT: inst_block78000015: -// CHECK:STDOUT: 0: inst7800001A +// CHECK:STDOUT: 0: inst78000019 // CHECK:STDOUT: inst_block78000016: +// CHECK:STDOUT: 0: inst7800001A +// CHECK:STDOUT: inst_block78000017: // CHECK:STDOUT: 0: inst78000018 // CHECK:STDOUT: 1: inst7800001B // CHECK:STDOUT: 2: inst7800001F @@ -2332,7 +2333,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 9: inst7800003D // CHECK:STDOUT: 10: inst7800003E // CHECK:STDOUT: 11: inst78000041 -// CHECK:STDOUT: inst_block78000017: +// CHECK:STDOUT: inst_block78000018: // CHECK:STDOUT: 0: inst78000017 // CHECK:STDOUT: 1: inst7800001A // CHECK:STDOUT: 2: inst7800001E @@ -2345,7 +2346,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 9: inst7800003A // CHECK:STDOUT: 10: inst7800003C // CHECK:STDOUT: 11: inst78000040 -// CHECK:STDOUT: inst_block78000018: +// CHECK:STDOUT: inst_block78000019: // CHECK:STDOUT: 0: inst78000051 // CHECK:STDOUT: 1: inst78000052 // CHECK:STDOUT: 2: inst78000053 @@ -2367,27 +2368,27 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 18: inst78000219 // CHECK:STDOUT: 19: inst7800021A // CHECK:STDOUT: 20: inst7800021B -// CHECK:STDOUT: inst_block78000019: +// CHECK:STDOUT: inst_block7800001A: // CHECK:STDOUT: 0: inst78000051 // CHECK:STDOUT: 1: inst78000052 -// CHECK:STDOUT: inst_block7800001A: -// CHECK:STDOUT: 0: inst7800005D // CHECK:STDOUT: inst_block7800001B: -// CHECK:STDOUT: 0: inst7800005E +// CHECK:STDOUT: 0: inst7800005D // CHECK:STDOUT: inst_block7800001C: -// CHECK:STDOUT: 0: inst7800005B +// CHECK:STDOUT: 0: inst7800005E // CHECK:STDOUT: inst_block7800001D: // CHECK:STDOUT: 0: inst7800005B +// CHECK:STDOUT: inst_block7800001E: +// CHECK:STDOUT: 0: inst7800005B // CHECK:STDOUT: 1: inst78000060 // CHECK:STDOUT: 2: inst78000061 -// CHECK:STDOUT: inst_block7800001E: +// CHECK:STDOUT: inst_block7800001F: // CHECK:STDOUT: 0: inst7800006D // CHECK:STDOUT: 1: inst7800006E -// CHECK:STDOUT: inst_block7800001F: -// CHECK:STDOUT: 0: inst78000070 // CHECK:STDOUT: inst_block78000020: -// CHECK:STDOUT: 0: inst78000074 +// CHECK:STDOUT: 0: inst78000070 // CHECK:STDOUT: inst_block78000021: +// CHECK:STDOUT: 0: inst78000074 +// CHECK:STDOUT: inst_block78000022: // CHECK:STDOUT: 0: inst78000075 // CHECK:STDOUT: 1: inst78000076 // CHECK:STDOUT: 2: inst78000077 @@ -2396,7 +2397,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst7800007A // CHECK:STDOUT: 6: inst7800007B // CHECK:STDOUT: 7: inst7800007C -// CHECK:STDOUT: inst_block78000022: +// CHECK:STDOUT: inst_block78000023: // CHECK:STDOUT: 0: inst7800005B // CHECK:STDOUT: 1: inst78000062 // CHECK:STDOUT: 2: inst78000063 @@ -2405,34 +2406,34 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst7800006B // CHECK:STDOUT: 6: inst78000064 // CHECK:STDOUT: 7: inst78000066 -// CHECK:STDOUT: inst_block78000023: -// CHECK:STDOUT: 0: inst7800007F // CHECK:STDOUT: inst_block78000024: // CHECK:STDOUT: 0: inst7800007F +// CHECK:STDOUT: inst_block78000025: +// CHECK:STDOUT: 0: inst7800007F // CHECK:STDOUT: 1: inst78000080 // CHECK:STDOUT: 2: inst78000081 -// CHECK:STDOUT: inst_block78000025: -// CHECK:STDOUT: 0: inst7800008D // CHECK:STDOUT: inst_block78000026: -// CHECK:STDOUT: 0: inst78000089 +// CHECK:STDOUT: 0: inst7800008D // CHECK:STDOUT: inst_block78000027: +// CHECK:STDOUT: 0: inst78000089 +// CHECK:STDOUT: inst_block78000028: // CHECK:STDOUT: 0: inst78000096 // CHECK:STDOUT: 1: inst78000089 // CHECK:STDOUT: 2: inst7800008A // CHECK:STDOUT: 3: inst7800008B // CHECK:STDOUT: 4: inst7800008C // CHECK:STDOUT: 5: inst7800008F -// CHECK:STDOUT: inst_block78000028: +// CHECK:STDOUT: inst_block78000029: // CHECK:STDOUT: 0: inst78000091 // CHECK:STDOUT: 1: inst78000092 -// CHECK:STDOUT: inst_block78000029: +// CHECK:STDOUT: inst_block7800002A: // CHECK:STDOUT: 0: inst7800009F // CHECK:STDOUT: 1: inst780000A0 -// CHECK:STDOUT: inst_block7800002A: -// CHECK:STDOUT: 0: inst780000A2 // CHECK:STDOUT: inst_block7800002B: -// CHECK:STDOUT: 0: inst780000A6 +// CHECK:STDOUT: 0: inst780000A2 // CHECK:STDOUT: inst_block7800002C: +// CHECK:STDOUT: 0: inst780000A6 +// CHECK:STDOUT: inst_block7800002D: // CHECK:STDOUT: 0: inst780000A7 // CHECK:STDOUT: 1: inst780000A8 // CHECK:STDOUT: 2: inst780000A9 @@ -2442,11 +2443,11 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst780000AD // CHECK:STDOUT: 7: inst780000AE // CHECK:STDOUT: 8: inst780000AF -// CHECK:STDOUT: inst_block7800002D: +// CHECK:STDOUT: inst_block7800002E: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst780000B1 // CHECK:STDOUT: 2: inst780000B2 -// CHECK:STDOUT: inst_block7800002E: +// CHECK:STDOUT: inst_block7800002F: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800008A // CHECK:STDOUT: 2: inst780000B6 @@ -2455,11 +2456,11 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst780000BA // CHECK:STDOUT: 6: inst780000B7 // CHECK:STDOUT: 7: inst780000B9 -// CHECK:STDOUT: inst_block7800002F: -// CHECK:STDOUT: 0: inst780000A7 // CHECK:STDOUT: inst_block78000030: // CHECK:STDOUT: 0: inst780000A7 // CHECK:STDOUT: inst_block78000031: +// CHECK:STDOUT: 0: inst780000A7 +// CHECK:STDOUT: inst_block78000032: // CHECK:STDOUT: 0: inst780000C0 // CHECK:STDOUT: 1: inst780000C1 // CHECK:STDOUT: 2: inst780000C2 @@ -2467,7 +2468,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst780000C4 // CHECK:STDOUT: 5: inst780000C5 // CHECK:STDOUT: 6: inst780000C6 -// CHECK:STDOUT: inst_block78000032: +// CHECK:STDOUT: inst_block78000033: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800008A // CHECK:STDOUT: 2: inst7800008B @@ -2477,52 +2478,52 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst7800009D // CHECK:STDOUT: 7: inst78000094 // CHECK:STDOUT: 8: inst78000098 -// CHECK:STDOUT: inst_block78000033: -// CHECK:STDOUT: 0: inst780000C9 // CHECK:STDOUT: inst_block78000034: -// CHECK:STDOUT: 0: inst780000CD +// CHECK:STDOUT: 0: inst780000C9 // CHECK:STDOUT: inst_block78000035: -// CHECK:STDOUT: 0: inst780000CF +// CHECK:STDOUT: 0: inst780000CD // CHECK:STDOUT: inst_block78000036: +// CHECK:STDOUT: 0: inst780000CF +// CHECK:STDOUT: inst_block78000037: // CHECK:STDOUT: 0: inst780000CE // CHECK:STDOUT: 1: inst780000CF // CHECK:STDOUT: 2: inst780000D0 // CHECK:STDOUT: 3: inst780000D1 // CHECK:STDOUT: 4: inst780000D2 // CHECK:STDOUT: 5: inst780000D3 -// CHECK:STDOUT: inst_block78000037: -// CHECK:STDOUT: 0: inst780000CF // CHECK:STDOUT: inst_block78000038: +// CHECK:STDOUT: 0: inst780000CF +// CHECK:STDOUT: inst_block78000039: // CHECK:STDOUT: 0: inst780000D4 // CHECK:STDOUT: 1: inst780000D5 -// CHECK:STDOUT: inst_block78000039: -// CHECK:STDOUT: 0: inst780000F1 // CHECK:STDOUT: inst_block7800003A: +// CHECK:STDOUT: 0: inst780000F1 +// CHECK:STDOUT: inst_block7800003B: // CHECK:STDOUT: 0: inst78000017 // CHECK:STDOUT: 1: inst7800001A // CHECK:STDOUT: 2: inst7800001E // CHECK:STDOUT: 3: inst780000F0 // CHECK:STDOUT: 4: inst780000F3 -// CHECK:STDOUT: inst_block7800003B: -// CHECK:STDOUT: 0: inst780000F4 // CHECK:STDOUT: inst_block7800003C: -// CHECK:STDOUT: 0: inst780000F8 +// CHECK:STDOUT: 0: inst780000F4 // CHECK:STDOUT: inst_block7800003D: -// CHECK:STDOUT: 0: inst780000FA +// CHECK:STDOUT: 0: inst780000F8 // CHECK:STDOUT: inst_block7800003E: +// CHECK:STDOUT: 0: inst780000FA +// CHECK:STDOUT: inst_block7800003F: // CHECK:STDOUT: 0: inst780000F9 // CHECK:STDOUT: 1: inst780000FA // CHECK:STDOUT: 2: inst780000FB // CHECK:STDOUT: 3: inst780000FC // CHECK:STDOUT: 4: inst780000FD -// CHECK:STDOUT: inst_block7800003F: +// CHECK:STDOUT: inst_block78000040: // CHECK:STDOUT: 0: inst7800010A // CHECK:STDOUT: 1: inst7800010B -// CHECK:STDOUT: inst_block78000040: -// CHECK:STDOUT: 0: inst7800010D // CHECK:STDOUT: inst_block78000041: -// CHECK:STDOUT: 0: inst78000111 +// CHECK:STDOUT: 0: inst7800010D // CHECK:STDOUT: inst_block78000042: +// CHECK:STDOUT: 0: inst78000111 +// CHECK:STDOUT: inst_block78000043: // CHECK:STDOUT: 0: inst78000112 // CHECK:STDOUT: 1: inst78000113 // CHECK:STDOUT: 2: inst78000114 @@ -2531,7 +2532,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst78000117 // CHECK:STDOUT: 6: inst78000118 // CHECK:STDOUT: 7: inst78000119 -// CHECK:STDOUT: inst_block78000043: +// CHECK:STDOUT: inst_block78000044: // CHECK:STDOUT: 0: inst7800001A // CHECK:STDOUT: 1: inst7800001E // CHECK:STDOUT: 2: inst78000020 @@ -2540,24 +2541,24 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst78000108 // CHECK:STDOUT: 6: inst78000101 // CHECK:STDOUT: 7: inst78000103 -// CHECK:STDOUT: inst_block78000044: -// CHECK:STDOUT: 0: inst780000FA // CHECK:STDOUT: inst_block78000045: +// CHECK:STDOUT: 0: inst780000FA +// CHECK:STDOUT: inst_block78000046: // CHECK:STDOUT: 0: inst7800011C // CHECK:STDOUT: 1: inst7800011D // CHECK:STDOUT: 2: inst7800011E -// CHECK:STDOUT: inst_block78000046: +// CHECK:STDOUT: inst_block78000047: // CHECK:STDOUT: 0: inst7800008A // CHECK:STDOUT: 1: inst7800012E -// CHECK:STDOUT: inst_block78000047: -// CHECK:STDOUT: 0: inst78000131 // CHECK:STDOUT: inst_block78000048: +// CHECK:STDOUT: 0: inst78000131 +// CHECK:STDOUT: inst_block78000049: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800012D -// CHECK:STDOUT: inst_block78000049: +// CHECK:STDOUT: inst_block7800004A: // CHECK:STDOUT: 0: inst78000059 // CHECK:STDOUT: 1: inst78000059 -// CHECK:STDOUT: inst_block7800004A: +// CHECK:STDOUT: inst_block7800004B: // CHECK:STDOUT: 0: inst78000096 // CHECK:STDOUT: 1: inst78000089 // CHECK:STDOUT: 2: inst7800013B @@ -2568,21 +2569,21 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 7: inst7800012F // CHECK:STDOUT: 8: inst78000130 // CHECK:STDOUT: 9: inst78000133 -// CHECK:STDOUT: inst_block7800004B: +// CHECK:STDOUT: inst_block7800004C: // CHECK:STDOUT: 0: inst78000135 // CHECK:STDOUT: 1: inst78000136 -// CHECK:STDOUT: inst_block7800004C: +// CHECK:STDOUT: inst_block7800004D: // CHECK:STDOUT: 0: inst78000144 // CHECK:STDOUT: 1: inst78000145 -// CHECK:STDOUT: inst_block7800004D: -// CHECK:STDOUT: 0: inst78000147 // CHECK:STDOUT: inst_block7800004E: +// CHECK:STDOUT: 0: inst78000147 +// CHECK:STDOUT: inst_block7800004F: // CHECK:STDOUT: 0: inst7800014B // CHECK:STDOUT: 1: inst7800014C -// CHECK:STDOUT: inst_block7800004F: +// CHECK:STDOUT: inst_block78000050: // CHECK:STDOUT: 0: inst7800014E // CHECK:STDOUT: 1: inst78000150 -// CHECK:STDOUT: inst_block78000050: +// CHECK:STDOUT: inst_block78000051: // CHECK:STDOUT: 0: inst7800014D // CHECK:STDOUT: 1: inst7800014E // CHECK:STDOUT: 2: inst7800014F @@ -2594,13 +2595,13 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 8: inst78000155 // CHECK:STDOUT: 9: inst78000156 // CHECK:STDOUT: 10: inst78000157 -// CHECK:STDOUT: inst_block78000051: -// CHECK:STDOUT: 0: inst7800012D // CHECK:STDOUT: inst_block78000052: // CHECK:STDOUT: 0: inst7800012D +// CHECK:STDOUT: inst_block78000053: +// CHECK:STDOUT: 0: inst7800012D // CHECK:STDOUT: 1: inst78000159 // CHECK:STDOUT: 2: inst7800015A -// CHECK:STDOUT: inst_block78000053: +// CHECK:STDOUT: inst_block78000054: // CHECK:STDOUT: 0: inst7800012D // CHECK:STDOUT: 1: inst7800012E // CHECK:STDOUT: 2: inst7800015E @@ -2609,15 +2610,15 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst78000162 // CHECK:STDOUT: 6: inst7800015F // CHECK:STDOUT: 7: inst78000161 -// CHECK:STDOUT: inst_block78000054: -// CHECK:STDOUT: 0: inst7800014D // CHECK:STDOUT: inst_block78000055: // CHECK:STDOUT: 0: inst7800014D // CHECK:STDOUT: inst_block78000056: -// CHECK:STDOUT: 0: inst7800014F +// CHECK:STDOUT: 0: inst7800014D // CHECK:STDOUT: inst_block78000057: // CHECK:STDOUT: 0: inst7800014F // CHECK:STDOUT: inst_block78000058: +// CHECK:STDOUT: 0: inst7800014F +// CHECK:STDOUT: inst_block78000059: // CHECK:STDOUT: 0: inst78000168 // CHECK:STDOUT: 1: inst78000169 // CHECK:STDOUT: 2: inst7800016A @@ -2631,7 +2632,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 10: inst78000172 // CHECK:STDOUT: 11: inst78000173 // CHECK:STDOUT: 12: inst78000174 -// CHECK:STDOUT: inst_block78000059: +// CHECK:STDOUT: inst_block7800005A: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800008A // CHECK:STDOUT: 2: inst7800012D @@ -2643,22 +2644,22 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 8: inst78000142 // CHECK:STDOUT: 9: inst78000138 // CHECK:STDOUT: 10: inst7800013D -// CHECK:STDOUT: inst_block7800005A: +// CHECK:STDOUT: inst_block7800005B: // CHECK:STDOUT: 0: inst78000177 // CHECK:STDOUT: 1: inst78000178 -// CHECK:STDOUT: inst_block7800005B: +// CHECK:STDOUT: inst_block7800005C: // CHECK:STDOUT: 0: inst7800017C // CHECK:STDOUT: 1: inst7800017D -// CHECK:STDOUT: inst_block7800005C: +// CHECK:STDOUT: inst_block7800005D: // CHECK:STDOUT: 0: inst7800017F // CHECK:STDOUT: 1: inst78000181 -// CHECK:STDOUT: inst_block7800005D: +// CHECK:STDOUT: inst_block7800005E: // CHECK:STDOUT: 0: inst78000183 // CHECK:STDOUT: 1: inst78000184 -// CHECK:STDOUT: inst_block7800005E: +// CHECK:STDOUT: inst_block7800005F: // CHECK:STDOUT: 0: inst7800017F // CHECK:STDOUT: 1: inst78000181 -// CHECK:STDOUT: inst_block7800005F: +// CHECK:STDOUT: inst_block78000060: // CHECK:STDOUT: 0: inst7800017E // CHECK:STDOUT: 1: inst7800017F // CHECK:STDOUT: 2: inst78000180 @@ -2669,27 +2670,27 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 7: inst78000185 // CHECK:STDOUT: 8: inst78000186 // CHECK:STDOUT: 9: inst78000187 -// CHECK:STDOUT: inst_block78000060: +// CHECK:STDOUT: inst_block78000061: // CHECK:STDOUT: 0: inst7800017F // CHECK:STDOUT: 1: inst78000181 -// CHECK:STDOUT: inst_block78000061: +// CHECK:STDOUT: inst_block78000062: // CHECK:STDOUT: 0: inst78000188 // CHECK:STDOUT: 1: inst78000189 -// CHECK:STDOUT: inst_block78000062: +// CHECK:STDOUT: inst_block78000063: // CHECK:STDOUT: 0: inst7800008A // CHECK:STDOUT: 1: inst7800012E // CHECK:STDOUT: 2: inst7800018D -// CHECK:STDOUT: inst_block78000063: -// CHECK:STDOUT: 0: inst78000190 // CHECK:STDOUT: inst_block78000064: +// CHECK:STDOUT: 0: inst78000190 +// CHECK:STDOUT: inst_block78000065: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800012D // CHECK:STDOUT: 2: inst7800018C -// CHECK:STDOUT: inst_block78000065: +// CHECK:STDOUT: inst_block78000066: // CHECK:STDOUT: 0: inst78000059 // CHECK:STDOUT: 1: inst78000059 // CHECK:STDOUT: 2: inst78000059 -// CHECK:STDOUT: inst_block78000066: +// CHECK:STDOUT: inst_block78000067: // CHECK:STDOUT: 0: inst78000096 // CHECK:STDOUT: 1: inst78000089 // CHECK:STDOUT: 2: inst7800013B @@ -2703,23 +2704,23 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 10: inst7800018E // CHECK:STDOUT: 11: inst7800018F // CHECK:STDOUT: 12: inst78000192 -// CHECK:STDOUT: inst_block78000067: +// CHECK:STDOUT: inst_block78000068: // CHECK:STDOUT: 0: inst78000194 // CHECK:STDOUT: 1: inst78000195 -// CHECK:STDOUT: inst_block78000068: +// CHECK:STDOUT: inst_block78000069: // CHECK:STDOUT: 0: inst780001A3 // CHECK:STDOUT: 1: inst780001A4 -// CHECK:STDOUT: inst_block78000069: -// CHECK:STDOUT: 0: inst780001A6 // CHECK:STDOUT: inst_block7800006A: +// CHECK:STDOUT: 0: inst780001A6 +// CHECK:STDOUT: inst_block7800006B: // CHECK:STDOUT: 0: inst780001AA // CHECK:STDOUT: 1: inst780001AB // CHECK:STDOUT: 2: inst780001AC -// CHECK:STDOUT: inst_block7800006B: +// CHECK:STDOUT: inst_block7800006C: // CHECK:STDOUT: 0: inst780001AE // CHECK:STDOUT: 1: inst780001B0 // CHECK:STDOUT: 2: inst780001B2 -// CHECK:STDOUT: inst_block7800006C: +// CHECK:STDOUT: inst_block7800006D: // CHECK:STDOUT: 0: inst780001AD // CHECK:STDOUT: 1: inst780001AE // CHECK:STDOUT: 2: inst780001AF @@ -2733,13 +2734,13 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 10: inst780001B7 // CHECK:STDOUT: 11: inst780001B8 // CHECK:STDOUT: 12: inst780001B9 -// CHECK:STDOUT: inst_block7800006D: -// CHECK:STDOUT: 0: inst7800018C // CHECK:STDOUT: inst_block7800006E: // CHECK:STDOUT: 0: inst7800018C +// CHECK:STDOUT: inst_block7800006F: +// CHECK:STDOUT: 0: inst7800018C // CHECK:STDOUT: 1: inst780001BB // CHECK:STDOUT: 2: inst780001BC -// CHECK:STDOUT: inst_block7800006F: +// CHECK:STDOUT: inst_block78000070: // CHECK:STDOUT: 0: inst7800018C // CHECK:STDOUT: 1: inst7800018D // CHECK:STDOUT: 2: inst780001C0 @@ -2748,19 +2749,19 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst780001C4 // CHECK:STDOUT: 6: inst780001C1 // CHECK:STDOUT: 7: inst780001C3 -// CHECK:STDOUT: inst_block78000070: -// CHECK:STDOUT: 0: inst780001AD // CHECK:STDOUT: inst_block78000071: // CHECK:STDOUT: 0: inst780001AD // CHECK:STDOUT: inst_block78000072: -// CHECK:STDOUT: 0: inst780001AF +// CHECK:STDOUT: 0: inst780001AD // CHECK:STDOUT: inst_block78000073: // CHECK:STDOUT: 0: inst780001AF // CHECK:STDOUT: inst_block78000074: -// CHECK:STDOUT: 0: inst780001B1 +// CHECK:STDOUT: 0: inst780001AF // CHECK:STDOUT: inst_block78000075: // CHECK:STDOUT: 0: inst780001B1 // CHECK:STDOUT: inst_block78000076: +// CHECK:STDOUT: 0: inst780001B1 +// CHECK:STDOUT: inst_block78000077: // CHECK:STDOUT: 0: inst780001CA // CHECK:STDOUT: 1: inst780001CB // CHECK:STDOUT: 2: inst780001CC @@ -2780,7 +2781,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 16: inst780001DA // CHECK:STDOUT: 17: inst780001DB // CHECK:STDOUT: 18: inst780001DC -// CHECK:STDOUT: inst_block78000077: +// CHECK:STDOUT: inst_block78000078: // CHECK:STDOUT: 0: inst78000089 // CHECK:STDOUT: 1: inst7800008A // CHECK:STDOUT: 2: inst7800012D @@ -2794,27 +2795,27 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 10: inst780001A1 // CHECK:STDOUT: 11: inst78000197 // CHECK:STDOUT: 12: inst7800019C -// CHECK:STDOUT: inst_block78000078: +// CHECK:STDOUT: inst_block78000079: // CHECK:STDOUT: 0: inst780001DF // CHECK:STDOUT: 1: inst780001E0 // CHECK:STDOUT: 2: inst780001E1 -// CHECK:STDOUT: inst_block78000079: +// CHECK:STDOUT: inst_block7800007A: // CHECK:STDOUT: 0: inst780001E5 // CHECK:STDOUT: 1: inst780001E6 // CHECK:STDOUT: 2: inst780001E7 -// CHECK:STDOUT: inst_block7800007A: +// CHECK:STDOUT: inst_block7800007B: // CHECK:STDOUT: 0: inst780001E9 // CHECK:STDOUT: 1: inst780001EB // CHECK:STDOUT: 2: inst780001ED -// CHECK:STDOUT: inst_block7800007B: +// CHECK:STDOUT: inst_block7800007C: // CHECK:STDOUT: 0: inst780001EF // CHECK:STDOUT: 1: inst780001F0 // CHECK:STDOUT: 2: inst780001F1 -// CHECK:STDOUT: inst_block7800007C: +// CHECK:STDOUT: inst_block7800007D: // CHECK:STDOUT: 0: inst780001E9 // CHECK:STDOUT: 1: inst780001EB // CHECK:STDOUT: 2: inst780001ED -// CHECK:STDOUT: inst_block7800007D: +// CHECK:STDOUT: inst_block7800007E: // CHECK:STDOUT: 0: inst780001E8 // CHECK:STDOUT: 1: inst780001E9 // CHECK:STDOUT: 2: inst780001EA @@ -2828,32 +2829,32 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 10: inst780001F2 // CHECK:STDOUT: 11: inst780001F3 // CHECK:STDOUT: 12: inst780001F4 -// CHECK:STDOUT: inst_block7800007E: +// CHECK:STDOUT: inst_block7800007F: // CHECK:STDOUT: 0: inst780001E9 // CHECK:STDOUT: 1: inst780001EB // CHECK:STDOUT: 2: inst780001ED -// CHECK:STDOUT: inst_block7800007F: +// CHECK:STDOUT: inst_block78000080: // CHECK:STDOUT: 0: inst780001F5 // CHECK:STDOUT: 1: inst780001F6 -// CHECK:STDOUT: inst_block78000080: +// CHECK:STDOUT: inst_block78000081: // CHECK:STDOUT: 0: inst780000FF // CHECK:STDOUT: 1: inst78000100 // CHECK:STDOUT: 2: inst7800004B -// CHECK:STDOUT: inst_block78000081: -// CHECK:STDOUT: 0: inst7800001B // CHECK:STDOUT: inst_block78000082: -// CHECK:STDOUT: 0: inst780001F7 +// CHECK:STDOUT: 0: inst7800001B // CHECK:STDOUT: inst_block78000083: -// CHECK:STDOUT: 0: inst780001FB +// CHECK:STDOUT: 0: inst780001F7 // CHECK:STDOUT: inst_block78000084: // CHECK:STDOUT: 0: inst780001FB +// CHECK:STDOUT: inst_block78000085: +// CHECK:STDOUT: 0: inst780001FB // CHECK:STDOUT: 1: inst780001FC // CHECK:STDOUT: 2: inst780001FD -// CHECK:STDOUT: inst_block78000085: -// CHECK:STDOUT: 0: inst78000201 // CHECK:STDOUT: inst_block78000086: -// CHECK:STDOUT: 0: inst78000202 +// CHECK:STDOUT: 0: inst78000201 // CHECK:STDOUT: inst_block78000087: +// CHECK:STDOUT: 0: inst78000202 +// CHECK:STDOUT: inst_block78000088: // CHECK:STDOUT: 0: inst780001FB // CHECK:STDOUT: 1: inst7800001E // CHECK:STDOUT: 2: inst78000020 @@ -2862,14 +2863,14 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst78000108 // CHECK:STDOUT: 6: inst78000101 // CHECK:STDOUT: 7: inst78000103 -// CHECK:STDOUT: inst_block78000088: -// CHECK:STDOUT: 0: inst78000202 // CHECK:STDOUT: inst_block78000089: -// CHECK:STDOUT: 0: inst78000051 +// CHECK:STDOUT: 0: inst78000202 // CHECK:STDOUT: inst_block7800008A: +// CHECK:STDOUT: 0: inst78000051 +// CHECK:STDOUT: inst_block7800008B: // CHECK:STDOUT: 0: inst78000214 // CHECK:STDOUT: 1: inst78000218 -// CHECK:STDOUT: inst_block7800008B: +// CHECK:STDOUT: inst_block7800008C: // CHECK:STDOUT: 0: inst7800004C // CHECK:STDOUT: 1: inst78000050 // CHECK:STDOUT: 2: inst780001FA @@ -2879,7 +2880,7 @@ fn Foo[T: type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst78000204 // CHECK:STDOUT: 7: inst78000205 // CHECK:STDOUT: 8: inst78000211 -// CHECK:STDOUT: inst_block7800008C: +// CHECK:STDOUT: inst_block7800008D: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst78000010 // CHECK:STDOUT: 2: inst78000047 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon index 1b50de857882..a1054b4f1622 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon @@ -34,7 +34,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0, form: inst, type: inst50000013} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block5000000B, call_params_id: inst_block5000000C, return_type_inst_id: inst50000022, return_form_inst_id: inst50000023, return_pattern_id: inst50000028, body: [inst_block5000000F]} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block5000000C, call_params_id: inst_block5000000D, return_type_inst_id: inst50000022, return_form_inst_id: inst50000023, return_pattern_id: inst50000028, body: [inst_block50000010]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} @@ -107,9 +107,9 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst50000019: {kind: WrapperBinding, arg0: entity_name50000000, arg1: inst5000002A, type: type(inst50000010)} // CHECK:STDOUT: inst5000001A: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst50000010)} // CHECK:STDOUT: inst5000001B: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst50000010)} -// CHECK:STDOUT: inst5000001C: {kind: TupleType, arg0: inst_block50000008, type: type(TypeType)} -// CHECK:STDOUT: inst5000001D: {kind: TupleLiteral, arg0: inst_block50000007, type: type(inst5000001C)} -// CHECK:STDOUT: inst5000001E: {kind: TupleValue, arg0: inst_block50000009, type: type(inst5000001C)} +// CHECK:STDOUT: inst5000001C: {kind: TupleType, arg0: inst_block50000009, type: type(TypeType)} +// CHECK:STDOUT: inst5000001D: {kind: TupleLiteral, arg0: inst_block50000008, type: type(inst5000001C)} +// CHECK:STDOUT: inst5000001E: {kind: TupleValue, arg0: inst_block5000000A, type: type(inst5000001C)} // CHECK:STDOUT: inst5000001F: {kind: PointerType, arg0: inst5000001C, type: type(TypeType)} // CHECK:STDOUT: inst50000020: {kind: Converted, arg0: inst50000012, arg1: inst50000010, type: type(TypeType)} // CHECK:STDOUT: inst50000021: {kind: Converted, arg0: inst50000012, arg1: inst50000010, type: type(TypeType)} @@ -122,15 +122,15 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst50000028: {kind: ReturnSlotPattern, arg0: inst50000026, arg1: inst50000022, type: type(inst50000025)} // CHECK:STDOUT: inst50000029: {kind: ReturnSlotPattern, arg0: inst50000027, arg1: inst5000001C, type: type(inst50000025)} // CHECK:STDOUT: inst5000002A: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst50000010)} -// CHECK:STDOUT: inst5000002B: {kind: SpliceBlock, arg0: inst_block50000005, arg1: inst50000013, type: type(TypeType)} +// CHECK:STDOUT: inst5000002B: {kind: SpliceBlock, arg0: inst_block50000006, arg1: inst50000013, type: type(TypeType)} // CHECK:STDOUT: inst5000002C: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst5000001C)} // CHECK:STDOUT: inst5000002D: {kind: ReturnSlot, arg0: inst5000001C, arg1: inst5000002C, type: type(inst5000001C)} -// CHECK:STDOUT: inst5000002E: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000000E, type: type(inst5000002F)} +// CHECK:STDOUT: inst5000002E: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block5000000F, type: type(inst5000002F)} // CHECK:STDOUT: inst5000002F: {kind: FunctionType, arg0: function50000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst50000030: {kind: StructValue, arg0: inst_block_empty, type: type(inst5000002F)} // CHECK:STDOUT: inst50000031: {kind: NameRef, arg0: name1, arg1: inst50000019, type: type(inst50000010)} // CHECK:STDOUT: inst50000032: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst50000010)} -// CHECK:STDOUT: inst50000033: {kind: TupleLiteral, arg0: inst_block50000010, type: type(inst5000001C)} +// CHECK:STDOUT: inst50000033: {kind: TupleLiteral, arg0: inst_block50000011, type: type(inst5000001C)} // CHECK:STDOUT: inst50000034: {kind: TupleAccess, arg0: inst5000002C, arg1: element0, type: type(inst50000010)} // CHECK:STDOUT: inst50000035: {kind: TupleInit, arg0: inst_block_empty, arg1: inst50000034, type: type(inst50000010)} // CHECK:STDOUT: inst50000036: {kind: Converted, arg0: inst50000031, arg1: inst50000035, type: type(inst50000010)} @@ -139,7 +139,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst50000039: {kind: TupleInit, arg0: inst_block_empty, arg1: inst50000038, type: type(inst50000010)} // CHECK:STDOUT: inst5000003A: {kind: Converted, arg0: inst50000032, arg1: inst50000039, type: type(inst50000010)} // CHECK:STDOUT: inst5000003B: {kind: InPlaceInit, arg0: inst5000003A, arg1: inst50000038, type: type(inst50000010)} -// CHECK:STDOUT: inst5000003C: {kind: TupleInit, arg0: inst_block50000011, arg1: inst5000002C, type: type(inst5000001C)} +// CHECK:STDOUT: inst5000003C: {kind: TupleInit, arg0: inst_block50000012, arg1: inst5000002C, type: type(inst5000001C)} // CHECK:STDOUT: inst5000003D: {kind: Converted, arg0: inst50000033, arg1: inst5000003C, type: type(inst5000001C)} // CHECK:STDOUT: inst5000003E: {kind: ReturnExpr, arg0: inst5000003D, arg1: inst5000002C} // CHECK:STDOUT: bundles: {} @@ -193,35 +193,36 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block50000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block50000006: // CHECK:STDOUT: 0: inst50000011 // CHECK:STDOUT: 1: inst50000013 -// CHECK:STDOUT: inst_block50000006: -// CHECK:STDOUT: 0: inst50000017 // CHECK:STDOUT: inst_block50000007: +// CHECK:STDOUT: 0: inst50000017 +// CHECK:STDOUT: inst_block50000008: // CHECK:STDOUT: 0: inst5000001A // CHECK:STDOUT: 1: inst5000001B -// CHECK:STDOUT: inst_block50000008: +// CHECK:STDOUT: inst_block50000009: // CHECK:STDOUT: 0: inst50000010 // CHECK:STDOUT: 1: inst50000010 -// CHECK:STDOUT: inst_block50000009: +// CHECK:STDOUT: inst_block5000000A: // CHECK:STDOUT: 0: inst50000012 // CHECK:STDOUT: 1: inst50000012 -// CHECK:STDOUT: inst_block5000000A: +// CHECK:STDOUT: inst_block5000000B: // CHECK:STDOUT: 0: inst50000020 // CHECK:STDOUT: 1: inst50000021 -// CHECK:STDOUT: inst_block5000000B: +// CHECK:STDOUT: inst_block5000000C: // CHECK:STDOUT: 0: inst50000015 // CHECK:STDOUT: 1: inst50000026 -// CHECK:STDOUT: inst_block5000000C: +// CHECK:STDOUT: inst_block5000000D: // CHECK:STDOUT: 0: inst5000002A // CHECK:STDOUT: 1: inst5000002C -// CHECK:STDOUT: inst_block5000000D: +// CHECK:STDOUT: inst_block5000000E: // CHECK:STDOUT: 0: inst50000015 // CHECK:STDOUT: 1: inst50000017 // CHECK:STDOUT: 2: inst50000026 // CHECK:STDOUT: 3: inst50000028 -// CHECK:STDOUT: inst_block5000000E: +// CHECK:STDOUT: inst_block5000000F: // CHECK:STDOUT: 0: inst5000001A // CHECK:STDOUT: 1: inst5000001B // CHECK:STDOUT: 2: inst5000001D @@ -234,7 +235,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 9: inst50000019 // CHECK:STDOUT: 10: inst5000002C // CHECK:STDOUT: 11: inst5000002D -// CHECK:STDOUT: inst_block5000000F: +// CHECK:STDOUT: inst_block50000010: // CHECK:STDOUT: 0: inst50000031 // CHECK:STDOUT: 1: inst50000032 // CHECK:STDOUT: 2: inst50000033 @@ -249,13 +250,13 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 11: inst5000003C // CHECK:STDOUT: 12: inst5000003D // CHECK:STDOUT: 13: inst5000003E -// CHECK:STDOUT: inst_block50000010: +// CHECK:STDOUT: inst_block50000011: // CHECK:STDOUT: 0: inst50000031 // CHECK:STDOUT: 1: inst50000032 -// CHECK:STDOUT: inst_block50000011: +// CHECK:STDOUT: inst_block50000012: // CHECK:STDOUT: 0: inst50000037 // CHECK:STDOUT: 1: inst5000003B -// CHECK:STDOUT: inst_block50000012: +// CHECK:STDOUT: inst_block50000013: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: 1: inst5000002E // CHECK:STDOUT: value_stores: diff --git a/toolchain/check/testdata/interop/cpp/function/export/default_values.carbon b/toolchain/check/testdata/interop/cpp/function/export/default_values.carbon new file mode 100644 index 000000000000..b4a082e60853 --- /dev/null +++ b/toolchain/check/testdata/interop/cpp/function/export/default_values.carbon @@ -0,0 +1,26 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/export/default_values.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/default_values.carbon + +// --- other.carbon +library "[[@TEST_NAME]]"; + +fn F(unused i: i32 = 0) {} + +// --- import.carbon +library "[[@TEST_NAME]]"; + +import library "other"; +import Cpp inline ''' +void CallF() { + Carbon::F(); +} +'''; diff --git a/toolchain/check/testdata/patterns/expression.carbon b/toolchain/check/testdata/patterns/expression.carbon index 48ebedbbea8b..fbd624976309 100644 --- a/toolchain/check/testdata/patterns/expression.carbon +++ b/toolchain/check/testdata/patterns/expression.carbon @@ -78,7 +78,7 @@ fn F() { // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (bool, bool) [concrete] // CHECK:STDOUT: %pattern_type.860: type = pattern_type %tuple.type [concrete] -// CHECK:STDOUT: %.2f0: %pattern_type.860 = tuple_pattern (@F.%expr_patt.loc12_26, @F.%expr_patt.loc12_43) [concrete] +// CHECK:STDOUT: %.108: %pattern_type.860 = tuple_pattern (@F.%expr_patt.loc12_26, @F.%expr_patt.loc12_43) [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%true, %true) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -117,7 +117,7 @@ fn F() { // CHECK:STDOUT: %.loc12_43: bool = block_arg !.loc12 [concrete = constants.%true] // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_51: %pattern_type.860 = tuple_pattern (%expr_patt.loc12_26, %expr_patt.loc12_43) [concrete = constants.%.2f0] +// CHECK:STDOUT: %.loc12_51: %pattern_type.860 = tuple_pattern (%expr_patt.loc12_26, %expr_patt.loc12_43) [concrete = constants.%.108] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/driver/testdata/stdin.carbon b/toolchain/driver/testdata/stdin.carbon index ef8d7a3a2907..4203e28c953b 100644 --- a/toolchain/driver/testdata/stdin.carbon +++ b/toolchain/driver/testdata/stdin.carbon @@ -89,7 +89,8 @@ // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block60000005: +// CHECK:STDOUT: extra_global_variables: {} +// CHECK:STDOUT: inst_block60000006: // CHECK:STDOUT: 0: inst(Package) // CHECK:STDOUT: value_stores: // CHECK:STDOUT: shared_values: diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 0d15cdd55a8e..8d8195ee6059 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -124,6 +124,9 @@ auto FileContext::LowerDefinitions() -> void { } } + // Lower any additional global variables defined outside of the top block. + LowerGlobalVariables(SemIR::InstBlockId::ExtraGlobalVariables); + // Lower function definitions. for (auto [id, fn_info] : sem_ir_->functions().enumerate()) { // If we created a declaration and the function definition is needed but not diff --git a/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon b/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon new file mode 100644 index 000000000000..81f16fc36496 --- /dev/null +++ b/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon @@ -0,0 +1,191 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon + +// --- first_function.carbon +package FirstFunction; +fn F(unused i: i32 = 0) {} + +// --- other_function.carbon +package OtherFunction; +fn F(unused i: i32 = 23) {} + +// --- basic.carbon +library "[[@TEST_NAME]]"; + +import OtherFunction; +import FirstFunction; +import Cpp inline ''' +void CallF() { + Carbon::OtherFunction::F(); + Carbon::FirstFunction::F(); +} +'''; + +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'first_function.carbon' +// CHECK:STDOUT: source_filename = "first_function.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF.FirstFunction(i32 %i) #0 !dbg !27 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!23} +// CHECK:STDOUT: !llvm.module.flags = !{!6, !7} +// CHECK:STDOUT: +// CHECK:STDOUT: !6 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !7 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !22 = !DIFile(filename: "first_function.carbon", directory: "") +// CHECK:STDOUT: !23 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !22, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{null, !24} +// CHECK:STDOUT: !26 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F", linkageName: "_CF.FirstFunction", scope: null, file: !22, line: 2, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !24) +// CHECK:STDOUT: !30 = !DILocation(line: 2, column: 1, scope: !27) +// CHECK:STDOUT: !31 = !{!28} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'other_function.carbon' +// CHECK:STDOUT: source_filename = "other_function.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF.OtherFunction(i32 %i) #0 !dbg !34 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!33} +// CHECK:STDOUT: !llvm.module.flags = !{!6, !7} +// CHECK:STDOUT: +// CHECK:STDOUT: !6 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !7 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{null, !24} +// CHECK:STDOUT: !26 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !32 = !DIFile(filename: "other_function.carbon", directory: "") +// CHECK:STDOUT: !33 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !32, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "F", linkageName: "_CF.OtherFunction", scope: null, file: !32, line: 2, type: !26, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !38) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !24) +// CHECK:STDOUT: !37 = !DILocation(line: 2, column: 1, scope: !34) +// CHECK:STDOUT: !38 = !{!35} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'basic.carbon' +// CHECK:STDOUT: source_filename = "basic.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: @_C__carbon_default_value__CF.OtherFunction_0.Main = global i32 0, align 4 +// CHECK:STDOUT: @_C__carbon_default_value__CF.FirstFunction_0.Main = global i32 0, align 4 +// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress uwtable +// CHECK:STDOUT: define dso_local void @_Z5CallFv() #0 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %0 = load i32, ptr @_C__carbon_default_value__CF.OtherFunction_0.Main, align 4, !tbaa !3 +// CHECK:STDOUT: call void @_ZN6Carbon13OtherFunctionL1FEi(i32 noundef %0) +// CHECK:STDOUT: %1 = load i32, ptr @_C__carbon_default_value__CF.FirstFunction_0.Main, align 4, !tbaa !3 +// CHECK:STDOUT: call void @_ZN6Carbon13FirstFunctionL1FEi(i32 noundef %1) +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable +// CHECK:STDOUT: define internal void @_ZN6Carbon13OtherFunctionL1FEi(i32 noundef %0) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.addr = alloca i32, align 4 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !3 +// CHECK:STDOUT: call void @_CF__carbon_thunk.OtherFunction(ptr noundef nonnull align 4 dereferenceable(4) %.addr) +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable +// CHECK:STDOUT: define internal void @_ZN6Carbon13FirstFunctionL1FEi(i32 noundef %0) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.addr = alloca i32, align 4 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !3 +// CHECK:STDOUT: call void @_CF__carbon_thunk.FirstFunction(ptr noundef nonnull align 4 dereferenceable(4) %.addr) +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @_CF.OtherFunction(i32) +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.OtherFunction(ptr %_) #2 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !43 +// CHECK:STDOUT: call void @_CF.OtherFunction(i32 %.1), !dbg !43 +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @_CF.FirstFunction(i32) +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.FirstFunction(ptr %_) #2 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !47 +// CHECK:STDOUT: call void @_CF.FirstFunction(i32 %.1), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: store i32 23, ptr @_C__carbon_default_value__CF.OtherFunction_0.Main, align 4 +// CHECK:STDOUT: store i32 0, ptr @_C__carbon_default_value__CF.FirstFunction_0.Main, align 4 +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!40} +// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} +// CHECK:STDOUT: !2 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !3 = !{!2, !2, i64 0} +// CHECK:STDOUT: !6 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !7 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !22 = !DIFile(filename: "first_function.carbon", directory: "") +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{null, !24} +// CHECK:STDOUT: !26 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !32 = !DIFile(filename: "other_function.carbon", directory: "") +// CHECK:STDOUT: !39 = !DIFile(filename: "basic.carbon", directory: "") +// CHECK:STDOUT: !40 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !39, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.OtherFunction", scope: null, file: !32, line: 2, type: !26, spFlags: DISPFlagDefinition, unit: !40, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !24) +// CHECK:STDOUT: !43 = !DILocation(line: 2, column: 1, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.FirstFunction", scope: null, file: !22, line: 2, type: !26, spFlags: DISPFlagDefinition, unit: !40, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !24) +// CHECK:STDOUT: !47 = !DILocation(line: 2, column: 1, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !{null} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !39, type: !50, spFlags: DISPFlagDefinition, unit: !40) +// CHECK:STDOUT: !52 = !DILocation(line: 0, scope: !51) +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !57 = !{!56, !2, i64 0} +// CHECK:STDOUT: diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index e9282ec23940..5ffd7ae178c8 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -339,6 +339,12 @@ class File : public Printable { auto set_top_inst_block_id(InstBlockId block_id) -> void { top_inst_block_id_ = block_id; } + auto default_value_globals_exported_to_cpp() const -> InstBlockId { + return default_value_globals_exported_to_cpp_; + } + auto set_default_value_globals_exports_to_cpp(InstBlockId block_id) -> void { + default_value_globals_exported_to_cpp_ = block_id; + } auto global_ctor_id() const -> FunctionId { return global_ctor_id_; } auto set_global_ctor_id(FunctionId function_id) -> void { global_ctor_id_ = function_id; @@ -477,6 +483,10 @@ class File : public Printable { // The top instruction block ID. InstBlockId top_inst_block_id_ = InstBlockId::None; + // An instruction block for storing any global variables used for exporting + // default values for function parameters to C++. + InstBlockId default_value_globals_exported_to_cpp_ = InstBlockId::None; + // The global constructor function id. FunctionId global_ctor_id_ = FunctionId::None; diff --git a/toolchain/sem_ir/ids.cpp b/toolchain/sem_ir/ids.cpp index 6877c4489a34..92af2b16f6fb 100644 --- a/toolchain/sem_ir/ids.cpp +++ b/toolchain/sem_ir/ids.cpp @@ -225,6 +225,8 @@ auto InstBlockId::Print(llvm::raw_ostream& out) const -> void { out << "imports"; } else if (*this == GlobalInit) { out << "global_init"; + } else if (*this == ExtraGlobalVariables) { + out << "extra_global_variables"; } else { IdBase::Print(out); } diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 9c63e0fcb582..a226af249398 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -803,8 +803,14 @@ struct InstBlockId : public IdBase { // be inserted into it. static const InstBlockId GlobalInit; + // Stores instructions defining global variables that might otherwise be + // defined in contexts where they won't be exported during lowering. This is + // useful, for example, when synthesizing function argument default values for + // export to C++. + static const InstBlockId ExtraGlobalVariables; + // A convenience list of reserved IDs. - static const std::array ReservedIds; + static const std::array ReservedIds; // An ID for unreachable code. static const InstBlockId Unreachable; @@ -823,10 +829,11 @@ inline constexpr InstBlockId InstBlockId::Exports = InstBlockId(1); inline constexpr InstBlockId InstBlockId::Generated = InstBlockId(2); inline constexpr InstBlockId InstBlockId::Imports = InstBlockId(3); inline constexpr InstBlockId InstBlockId::GlobalInit = InstBlockId(4); +inline constexpr InstBlockId InstBlockId::ExtraGlobalVariables = InstBlockId(5); inline constexpr InstBlockId InstBlockId::Unreachable = InstBlockId(NoneIndex - 1); -inline constexpr std::array InstBlockId::ReservedIds = { - Empty, Exports, Generated, Imports, GlobalInit}; +inline constexpr std::array InstBlockId::ReservedIds = { + Empty, Exports, Generated, Imports, GlobalInit, ExtraGlobalVariables}; // Contains either an `InstBlockId` value, an error value, or // `InstBlockId::None`. diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index 3887b1d46a62..92c4eb922603 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -109,6 +109,7 @@ TEST(SemIRTest, Yaml) { Pair("generated", Yaml::Mapping(IsEmpty())), Pair("imports", Yaml::Mapping(IsEmpty())), Pair("global_init", Yaml::Mapping(IsEmpty())), + Pair("extra_global_variables", Yaml::Mapping(IsEmpty())), // There are 5 non-reserved inst blocks. inst_block, inst_block, inst_block, inst_block, inst_block))), Pair("value_stores",