From 3d603fced7eb0bcee208056ef76322d57d58e387 Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Tue, 10 Jun 2025 19:17:19 +0200 Subject: [PATCH] Fix C++ function params and return values printed in SemIR (#5468) Fix `pattern_block_id` and `call_params_id` for C++ function decl import, to get the correct SemIR printout for the C++ functions i.e. 1) Fill in missing parameter info in the function decls: ``` // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { // CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i16 = value_param call_param0 // CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i16 = bind_name a, %a.param // CHECK:STDOUT: } ``` 2) Print the params and return values: ``` // CHECK:STDOUT: fn @foo_short() -> %i16; ``` ``` // CHECK:STDOUT: fn @foo(%a.param: %i16); ``` Closes #5449 --- toolchain/check/import_cpp.cpp | 129 +++++--- .../interop/cpp/function_param_int16.carbon | 211 +++++++++---- .../interop/cpp/function_param_int32.carbon | 284 ++++++++++++++---- .../cpp/function_param_unsupported.carbon | 4 - .../interop/cpp/function_return.carbon | 34 ++- 5 files changed, 491 insertions(+), 171 deletions(-) diff --git a/toolchain/check/import_cpp.cpp b/toolchain/check/import_cpp.cpp index 33c7595379be..39f81bd18867 100644 --- a/toolchain/check/import_cpp.cpp +++ b/toolchain/check/import_cpp.cpp @@ -25,6 +25,8 @@ #include "toolchain/check/import.h" #include "toolchain/check/inst.h" #include "toolchain/check/literal.h" +#include "toolchain/check/pattern.h" +#include "toolchain/check/pattern_match.h" #include "toolchain/check/type.h" #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/diagnostics/format_providers.h" @@ -341,53 +343,67 @@ static auto MapType(Context& context, clang::QualType type) -> TypeExpr { // declaration. If the function declaration has no parameters, it returns // `SemIR::InstBlockId::Empty`. In the case of an unsupported parameter type, it // returns `SemIR::InstBlockId::None`. +// TODO: Consider refactoring to extract and reuse more logic from +// `HandleAnyBindingPattern()`. static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id, const clang::FunctionDecl& clang_decl) -> SemIR::InstBlockId { if (clang_decl.parameters().empty()) { return SemIR::InstBlockId::Empty; } - SemIR::CallParamIndex next_index(0); llvm::SmallVector params; params.reserve(clang_decl.parameters().size()); for (const clang::ParmVarDecl* param : clang_decl.parameters()) { clang::QualType param_type = param->getType().getCanonicalType(); - SemIR::TypeId type_id = - GetPatternType(context, MapType(context, param_type).type_id); + + // Mark the start of a region of insts, needed for the type expression + // created later with the call of `EndSubpatternAsExpr()`. + BeginSubpattern(context); + auto [type_inst_id, type_id] = MapType(context, param_type); + // Type expression of the binding pattern - a single-entry/single-exit + // region that allows control flow in the type expression e.g. fn F(x: if C + // then i32 else i64). + SemIR::ExprRegionId type_expr_region_id = + EndSubpatternAsExpr(context, type_inst_id); + if (type_id == SemIR::ErrorInst::TypeId) { context.TODO(loc_id, llvm::formatv("Unsupported: parameter type: {0}", param_type.getAsString())); return SemIR::InstBlockId::None; } + llvm::StringRef param_name = param->getName(); - SemIR::EntityNameId entity_name_id = context.entity_names().Add( - {.name_id = - (param_name.empty()) - // Translate an unnamed parameter to an underscore to - // match Carbon's naming of unnamed/unused function params. - ? SemIR::NameId::Underscore - : SemIR::NameId::ForIdentifier( - context.sem_ir().identifiers().Add(param_name)), - .parent_scope_id = SemIR::NameScopeId::None}); - SemIR::InstId binding_pattern_id = AddInstInNoBlock( + SemIR::NameId name_id = + param_name.empty() + // Translate an unnamed parameter to an underscore to + // match Carbon's naming of unnamed/unused function params. + ? SemIR::NameId::Underscore + : SemIR::NameId::ForIdentifier( + context.sem_ir().identifiers().Add(param_name)); + + // TODO: Fix this once templates are supported. + bool is_template = false; + // TODO: Fix this once generics are supported. + bool is_generic = false; + SemIR::InstId binding_pattern_id = // TODO: Fill in a location once available. - context, SemIR::LocIdAndInst::NoLoc(SemIR::BindingPattern( - {.type_id = type_id, .entity_name_id = entity_name_id}))); - SemIR::InstId var_pattern_id = AddInstInNoBlock( + AddBindingPattern(context, SemIR::LocId::None, name_id, type_id, + type_expr_region_id, is_generic, is_template) + .pattern_id; + SemIR::InstId var_pattern_id = AddPatternInst( context, // TODO: Fill in a location once available. SemIR::LocIdAndInst::NoLoc(SemIR::ValueParamPattern( {.type_id = context.insts().Get(binding_pattern_id).type_id(), .subpattern_id = binding_pattern_id, - .index = next_index}))); - ++next_index.index; + .index = SemIR::CallParamIndex::None}))); params.push_back(var_pattern_id); } return context.inst_blocks().Add(params); } -// Returns the return type of the given function declaration. -// Currently only void and 32-bit int are supported. +// Returns the return type of the given function declaration. In case of an +// unsupported return type, it returns `SemIR::ErrorInst::InstId`. // TODO: Support more return types. static auto GetReturnType(Context& context, SemIR::LocId loc_id, const clang::FunctionDecl* clang_decl) @@ -396,6 +412,7 @@ static auto GetReturnType(Context& context, SemIR::LocId loc_id, if (ret_type->isVoidType()) { return SemIR::InstId::None; } + auto [type_inst_id, type_id] = MapType(context, ret_type); if (type_id == SemIR::ErrorInst::TypeId) { context.TODO(loc_id, llvm::formatv("Unsupported: return type: {0}", @@ -403,12 +420,12 @@ static auto GetReturnType(Context& context, SemIR::LocId loc_id, return SemIR::ErrorInst::InstId; } auto pattern_type_id = GetPatternType(context, type_id); - SemIR::InstId return_slot_pattern_id = AddInstInNoBlock( + SemIR::InstId return_slot_pattern_id = AddPatternInst( // TODO: Fill in a location for the return type once available. context, SemIR::LocIdAndInst::NoLoc(SemIR::ReturnSlotPattern( {.type_id = pattern_type_id, .type_inst_id = type_inst_id}))); - SemIR::InstId param_pattern_id = AddInstInNoBlock( + SemIR::InstId param_pattern_id = AddPatternInst( // TODO: Fill in a location for the return type once available. context, SemIR::LocIdAndInst::NoLoc(SemIR::OutParamPattern( {.type_id = pattern_type_id, @@ -417,6 +434,46 @@ static auto GetReturnType(Context& context, SemIR::LocId loc_id, return param_pattern_id; } +namespace { +// Represents the parameter patterns block id, the return slot pattern id and +// the call parameters block id for a function declaration. +struct FunctionParamsInsts { + SemIR::InstBlockId param_patterns_id; + SemIR::InstId return_slot_pattern_id; + SemIR::InstBlockId call_params_id; +}; +} // namespace + +// Creates a block containing the parameter pattern instructions for the +// explicit parameters, a parameter pattern instruction for the return type and +// a block containing the call parameters of the function. Emits a callee +// pattern-match for the explicit parameter patterns and the return slot pattern +// to create the Call parameters instructions block. Currently the implicit +// parameter patterns are not taken into account. Returns the parameter patterns +// block id, the return slot pattern id, and the call parameters block id. +// Returns `std::nullopt` if the function declaration has an unsupported +// parameter type. +static auto CreateFunctionParamsInsts(Context& context, SemIR::LocId loc_id, + const clang::FunctionDecl* clang_decl) + -> std::optional { + auto param_patterns_id = + MakeParamPatternsBlockId(context, loc_id, *clang_decl); + if (!param_patterns_id.has_value()) { + return std::nullopt; + } + auto return_slot_pattern_id = GetReturnType(context, loc_id, clang_decl); + if (SemIR::ErrorInst::InstId == return_slot_pattern_id) { + return std::nullopt; + } + // TODO: Add support for implicit parameters. + auto call_params_id = CalleePatternMatch( + context, /*implicit_param_patterns_id=*/SemIR::InstBlockId::None, + param_patterns_id, return_slot_pattern_id); + return {{.param_patterns_id = param_patterns_id, + .return_slot_pattern_id = return_slot_pattern_id, + .call_params_id = call_params_id}}; +} + // Imports a function declaration from Clang to Carbon. If successful, returns // the new Carbon function declaration `InstId`. static auto ImportFunctionDecl(Context& context, SemIR::LocId loc_id, @@ -436,18 +493,22 @@ static auto ImportFunctionDecl(Context& context, SemIR::LocId loc_id, context.TODO(loc_id, "Unsupported: Template function"); return SemIR::ErrorInst::InstId; } - auto param_patterns_id = - MakeParamPatternsBlockId(context, loc_id, *clang_decl); - if (!param_patterns_id.has_value()) { - return SemIR::ErrorInst::InstId; - } - auto return_slot_pattern_id = GetReturnType(context, loc_id, clang_decl); - if (SemIR::ErrorInst::InstId == return_slot_pattern_id) { + + context.inst_block_stack().Push(); + context.pattern_block_stack().Push(); + + auto function_params_insts = + CreateFunctionParamsInsts(context, loc_id, clang_decl); + + auto pattern_block_id = context.pattern_block_stack().Pop(); + auto decl_block_id = context.inst_block_stack().Pop(); + + if (!function_params_insts.has_value()) { return SemIR::ErrorInst::InstId; } auto function_decl = SemIR::FunctionDecl{ - SemIR::TypeId::None, SemIR::FunctionId::None, SemIR::InstBlockId::Empty}; + SemIR::TypeId::None, SemIR::FunctionId::None, decl_block_id}; auto decl_id = AddPlaceholderInstInNoBlock(context, Parse::NodeId::None, function_decl); context.imports().push_back(decl_id); @@ -458,16 +519,16 @@ static auto ImportFunctionDecl(Context& context, SemIR::LocId loc_id, .generic_id = SemIR::GenericId::None, .first_param_node_id = Parse::NodeId::None, .last_param_node_id = Parse::NodeId::None, - .pattern_block_id = SemIR::InstBlockId::Empty, + .pattern_block_id = pattern_block_id, .implicit_param_patterns_id = SemIR::InstBlockId::Empty, - .param_patterns_id = param_patterns_id, + .param_patterns_id = function_params_insts->param_patterns_id, .is_extern = false, .extern_library_id = SemIR::LibraryNameId::None, .non_owning_decl_id = SemIR::InstId::None, .first_owning_decl_id = decl_id, .definition_id = SemIR::InstId::None}, - {.call_params_id = SemIR::InstBlockId::Empty, - .return_slot_pattern_id = return_slot_pattern_id, + {.call_params_id = function_params_insts->call_params_id, + .return_slot_pattern_id = function_params_insts->return_slot_pattern_id, .virtual_modifier = SemIR::FunctionFields::VirtualModifier::None, .self_param_id = SemIR::InstId::None, .clang_decl_id = context.sem_ir().clang_decls().Add(clang_decl)}}; diff --git a/toolchain/check/testdata/interop/cpp/function_param_int16.carbon b/toolchain/check/testdata/interop/cpp/function_param_int16.carbon index 8261c8d9dfde..c1ac1b41f5e3 100644 --- a/toolchain/check/testdata/interop/cpp/function_param_int16.carbon +++ b/toolchain/check/testdata/interop/cpp/function_param_int16.carbon @@ -306,6 +306,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -339,7 +340,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -361,12 +372,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -378,7 +387,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_max.carbon // CHECK:STDOUT: @@ -390,6 +399,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_32767.f4b: Core.IntLiteral = int_value 32767 [concrete] @@ -423,7 +433,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -445,8 +465,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [concrete = constants.%int_32767.f4b] // CHECK:STDOUT: %impl.elem0: %.236 = impl_witness_access constants.%ImplicitAs.impl_witness.97b, element0 [concrete = constants.%Convert.d0a] @@ -460,7 +478,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_short_overflow_max.carbon // CHECK:STDOUT: @@ -472,6 +490,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_32768.4d0: Core.IntLiteral = int_value 32768 [concrete] @@ -505,7 +524,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -527,8 +556,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [concrete = constants.%int_32768.4d0] // CHECK:STDOUT: %impl.elem0: %.236 = impl_witness_access constants.%ImplicitAs.impl_witness.97b, element0 [concrete = constants.%Convert.d0a] @@ -542,7 +569,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_min.carbon // CHECK:STDOUT: @@ -554,6 +581,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [concrete] @@ -597,7 +625,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba] // CHECK:STDOUT: %Negate.impl_witness_table.e09 = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete] @@ -622,8 +660,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [concrete = constants.%int_32768] // CHECK:STDOUT: %impl.elem0.loc7_11.1: %.63a = impl_witness_access constants.%Negate.impl_witness.561, element0 [concrete = constants.%Op.bba] @@ -642,7 +678,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_short_overflow_min.carbon // CHECK:STDOUT: @@ -654,6 +690,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [concrete] @@ -697,7 +734,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba] // CHECK:STDOUT: %Negate.impl_witness_table.e09 = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete] @@ -722,8 +769,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [concrete = constants.%int_32769] // CHECK:STDOUT: %impl.elem0.loc12_11.1: %.63a = impl_witness_access constants.%Negate.impl_witness.561, element0 [concrete = constants.%Op.bba] @@ -742,7 +787,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_short_int32_arg.carbon // CHECK:STDOUT: @@ -754,6 +799,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -792,7 +838,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -815,8 +871,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -833,7 +887,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_int.carbon // CHECK:STDOUT: @@ -845,6 +899,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -878,7 +933,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -900,12 +965,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -917,7 +980,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_short.carbon // CHECK:STDOUT: @@ -929,6 +992,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -962,7 +1026,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -984,12 +1058,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -1001,7 +1073,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_short_int.carbon // CHECK:STDOUT: @@ -1013,6 +1085,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1046,7 +1119,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -1068,12 +1151,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -1085,7 +1166,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_int16_t.carbon // CHECK:STDOUT: @@ -1097,6 +1178,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1130,7 +1212,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -1152,12 +1244,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -1169,7 +1259,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- import_const_short.carbon // CHECK:STDOUT: @@ -1181,6 +1271,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1214,7 +1305,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i16 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)] // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete] @@ -1236,12 +1337,10 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.91d = impl_witness_access constants.%As.impl_witness.0ef, element0 [concrete = constants.%Convert.489] // CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_16) [concrete = constants.%Convert.specific_fn] @@ -1253,7 +1352,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i16); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_short_ref.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function_param_int32.carbon b/toolchain/check/testdata/interop/cpp/function_param_int32.carbon index cfcfe718a7b7..bf00feb369cd 100644 --- a/toolchain/check/testdata/interop/cpp/function_param_int32.carbon +++ b/toolchain/check/testdata/interop/cpp/function_param_int32.carbon @@ -360,6 +360,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -393,7 +394,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -415,8 +426,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -430,7 +439,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_int_max.carbon // CHECK:STDOUT: @@ -442,6 +451,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [concrete] @@ -475,7 +485,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -497,8 +517,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -512,7 +530,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_int_overflow_max.carbon // CHECK:STDOUT: @@ -524,6 +542,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_2147483648.1db: Core.IntLiteral = int_value 2147483648 [concrete] @@ -557,7 +576,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -579,8 +608,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_2147483648: Core.IntLiteral = int_value 2147483648 [concrete = constants.%int_2147483648.1db] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -594,7 +621,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_int_min.carbon // CHECK:STDOUT: @@ -606,6 +633,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_2147483648: Core.IntLiteral = int_value 2147483648 [concrete] @@ -649,7 +677,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba] // CHECK:STDOUT: %Negate.impl_witness_table.e09 = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete] @@ -674,8 +712,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_2147483648: Core.IntLiteral = int_value 2147483648 [concrete = constants.%int_2147483648] // CHECK:STDOUT: %impl.elem0.loc7_11.1: %.63a = impl_witness_access constants.%Negate.impl_witness.561, element0 [concrete = constants.%Op.bba] @@ -694,7 +730,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_int_overflow_min.carbon // CHECK:STDOUT: @@ -706,6 +742,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_2147483649: Core.IntLiteral = int_value 2147483649 [concrete] @@ -749,7 +786,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba] // CHECK:STDOUT: %Negate.impl_witness_table.e09 = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete] @@ -774,8 +821,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_2147483649: Core.IntLiteral = int_value 2147483649 [concrete = constants.%int_2147483649] // CHECK:STDOUT: %impl.elem0.loc12_11.1: %.63a = impl_witness_access constants.%Negate.impl_witness.561, element0 [concrete = constants.%Op.bba] @@ -794,7 +839,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_int.carbon // CHECK:STDOUT: @@ -806,6 +851,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -839,7 +885,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -861,8 +917,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -876,7 +930,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed.carbon // CHECK:STDOUT: @@ -888,6 +942,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -921,7 +976,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -943,8 +1008,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -958,7 +1021,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_int32_t.carbon // CHECK:STDOUT: @@ -970,6 +1033,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1003,7 +1067,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -1025,8 +1099,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -1040,7 +1112,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_ints.carbon // CHECK:STDOUT: @@ -1052,6 +1124,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1089,7 +1162,25 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32.1 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param call_param1 +// CHECK:STDOUT: %.2: type = splice_block %i32.2 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -1111,10 +1202,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] @@ -1136,7 +1223,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32, %b.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_multiple_ints.carbon // CHECK:STDOUT: @@ -1148,6 +1235,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo1.type: type = fn_type @foo1 [concrete] // CHECK:STDOUT: %foo1: %foo1.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1196,11 +1284,47 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo1.decl: %foo1.type = fn_decl @foo1 [concrete = constants.%foo1] {} {} +// CHECK:STDOUT: %foo1.decl: %foo1.type = fn_decl @foo1 [concrete = constants.%foo1] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32.1 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param call_param1 +// CHECK:STDOUT: %.2: type = splice_block %i32.2 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: %foo2.decl: %foo2.type = fn_decl @foo2 [concrete = constants.%foo2] {} {} +// CHECK:STDOUT: %foo2.decl: %foo2.type = fn_decl @foo2 [concrete = constants.%foo2] { +// CHECK:STDOUT: %c.patt: %pattern_type.7ce = binding_pattern c [concrete] +// CHECK:STDOUT: %c.param_patt: %pattern_type.7ce = value_param_pattern %c.patt, call_param0 [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %c.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32.1 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %b.param: %i32 = value_param call_param1 +// CHECK:STDOUT: %.2: type = splice_block %i32.2 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1219,10 +1343,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc7: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo1.ref: %foo1.type = name_ref foo1, imports.%foo1.decl [concrete = constants.%foo1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] @@ -1242,10 +1362,6 @@ fn F() { // CHECK:STDOUT: %.loc7_15.2: %i32 = converted %int_2, %.loc7_15.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %foo1.call: init %empty_tuple.type = call %foo1.ref(%.loc7_12.2, %.loc7_15.2) // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32.3: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.3: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo2.ref: %foo2.type = name_ref foo2, imports.%foo2.decl [concrete = constants.%foo2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] @@ -1267,9 +1383,9 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo1(); +// CHECK:STDOUT: fn @foo1(%a.param: %i32, %b.param: %i32); // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo2(); +// CHECK:STDOUT: fn @foo2(%c.param: %i32, %b.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_unnamed_int.carbon // CHECK:STDOUT: @@ -1281,6 +1397,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1314,7 +1431,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %_.patt: %pattern_type.7ce = binding_pattern _ [concrete] +// CHECK:STDOUT: %_.param_patt: %pattern_type.7ce = value_param_pattern %_.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %_.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %_: %i32 = bind_name _, %_.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -1336,8 +1463,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -1351,7 +1476,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%_.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_int_default_parameterless_call.carbon // CHECK:STDOUT: @@ -1362,6 +1487,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -1377,7 +1503,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1396,13 +1532,11 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_int_default_sucessful_call.carbon // CHECK:STDOUT: @@ -1414,6 +1548,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1447,7 +1582,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -1469,8 +1614,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -1484,7 +1627,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- import_const_int.carbon // CHECK:STDOUT: @@ -1496,6 +1639,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1529,7 +1673,17 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {} +// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { +// CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] @@ -1551,8 +1705,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] @@ -1566,7 +1718,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo(); +// CHECK:STDOUT: fn @foo(%a.param: %i32); // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_int_ref.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function_param_unsupported.carbon b/toolchain/check/testdata/interop/cpp/function_param_unsupported.carbon index 877bf3b8a750..78092829c5cf 100644 --- a/toolchain/check/testdata/interop/cpp/function_param_unsupported.carbon +++ b/toolchain/check/testdata/interop/cpp/function_param_unsupported.carbon @@ -106,10 +106,8 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %float: f64 = float_literal 2 [concrete] // CHECK:STDOUT: } @@ -143,8 +141,6 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %float: f64 = float_literal 2 [concrete = constants.%float] diff --git a/toolchain/check/testdata/interop/cpp/function_return.carbon b/toolchain/check/testdata/interop/cpp/function_return.carbon index f4238793ae83..617638ea88fe 100644 --- a/toolchain/check/testdata/interop/cpp/function_return.carbon +++ b/toolchain/check/testdata/interop/cpp/function_return.carbon @@ -99,7 +99,15 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo_short.decl: %foo_short.type = fn_decl @foo_short [concrete = constants.%foo_short] {} {} +// CHECK:STDOUT: %foo_short.decl: %foo_short.type = fn_decl @foo_short [concrete = constants.%foo_short] { +// CHECK:STDOUT: %return.patt: %pattern_type.2f8 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.2f8 = out_param_pattern %return.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %return.param: ref %i16 = out_param call_param0 +// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -121,13 +129,11 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.2f8 = binding_pattern x [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_16.1: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.1: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %foo_short.ref: %foo_short.type = name_ref foo_short, imports.%foo_short.decl [concrete = constants.%foo_short] // CHECK:STDOUT: %foo_short.call: init %i16 = call %foo_short.ref() -// CHECK:STDOUT: %.loc7_10: type = splice_block %i16.loc7 [concrete = constants.%i16] { -// CHECK:STDOUT: %int_16.loc7: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc7: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %.loc7_10: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7_30.1: ref %i16 = temporary_storage // CHECK:STDOUT: %.loc7_30.2: ref %i16 = temporary %.loc7_30.1, %foo_short.call @@ -135,7 +141,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo_short(); +// CHECK:STDOUT: fn @foo_short() -> %i16; // CHECK:STDOUT: // CHECK:STDOUT: --- import_int.carbon // CHECK:STDOUT: @@ -165,7 +171,15 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %foo_int.decl: %foo_int.type = fn_decl @foo_int [concrete = constants.%foo_int] {} {} +// CHECK:STDOUT: %foo_int.decl: %foo_int.type = fn_decl @foo_int [concrete = constants.%foo_int] { +// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -199,8 +213,6 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Carbon_foo.ref: %Carbon_foo.type = name_ref Carbon_foo, file.%Carbon_foo.decl [concrete = constants.%Carbon_foo] // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %foo_int.ref: %foo_int.type = name_ref foo_int, imports.%foo_int.decl [concrete = constants.%foo_int] // CHECK:STDOUT: %foo_int.call: init %i32 = call %foo_int.ref() // CHECK:STDOUT: %.loc9_26.1: %i32 = value_of_initializer %foo_int.call @@ -209,7 +221,7 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @foo_int(); +// CHECK:STDOUT: fn @foo_int() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_float.carbon // CHECK:STDOUT: