diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 78deb7af17dd..b60192e3bd6d 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -305,8 +305,8 @@ auto PerformCallToFunction(Context& context, SemIR::LocId loc_id, } // Convert the arguments to match the parameters. auto converted_args_id = - ConvertCallArgs(context, callee_function.self_id, arg_ids, return_arg_id, - callee, *callee_specific_id, is_desugared); + ConvertCallArgs(context, loc_id, callee_function.self_id, arg_ids, + return_arg_id, callee, *callee_specific_id, is_desugared); switch (callee.special_function_kind) { case SemIR::Function::SpecialFunctionKind::Thunk: { // If we're about to form a direct call to a thunk, inline it. diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 24e2f0913a13..df75e5aede99 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -186,19 +186,20 @@ static auto VisitAllTemporaryStorageArgs( // Materializes and returns a temporary initialized from the initializer // `init_id`. If `init_id` has a storage arg, it must be a `TemporaryStorage`; // if not, this function allocates one for it. -static auto MaterializeTemporary(Context& context, SemIR::InstId init_id) - -> SemIR::InstId { +static auto MaterializeTemporary(Context& context, SemIR::LocId loc_id, + SemIR::InstId init_id) -> SemIR::InstId { auto& sem_ir = context.sem_ir(); auto category = SemIR::GetExprCategory(sem_ir, init_id); CARBON_CHECK(SemIR::IsInitializerCategory(category)); auto init = sem_ir.insts().Get(init_id); auto storage_id = FindStorageArgForInitializer(sem_ir, init_id); + auto init_loc_id = GetInstLocationOrFallback(context, init_id, loc_id); if (!storage_id.has_value()) { CARBON_CHECK(category == SemIR::ExprCategory::ReprInitializing); // The initializer has no storage arg, but we want to produce an ephemeral // reference, so we need to allocate temporary storage. - storage_id = AddInst( - context, SemIR::LocId(init_id), {.type_id = init.type_id()}); + storage_id = AddInst(context, init_loc_id, + {.type_id = init.type_id()}); } CARBON_CHECK( @@ -206,7 +207,7 @@ static auto MaterializeTemporary(Context& context, SemIR::InstId init_id) "Storage arg for initializer does not contain a temporary; " "initialized multiple times? Have {0}", sem_ir.insts().Get(storage_id)); - return AddInstWithCleanup(context, SemIR::LocId(init_id), + return AddInstWithCleanup(context, init_loc_id, {.type_id = init.type_id(), .storage_id = storage_id, .init_id = init_id}); @@ -217,8 +218,8 @@ static auto MaterializeTemporary(Context& context, SemIR::InstId init_id) // // TODO: We should probably start its lifetime unconditionally, because // types with by-copy representations can still have nontrivial destructors. -static auto DiscardInitializer(Context& context, SemIR::InstId init_id) - -> void { +static auto DiscardInitializer(Context& context, SemIR::LocId loc_id, + SemIR::InstId init_id) -> void { auto& sem_ir = context.sem_ir(); auto storage_id = FindStorageArgForInitializer(sem_ir, init_id); if (!storage_id.has_value()) { @@ -229,16 +230,16 @@ static auto DiscardInitializer(Context& context, SemIR::InstId init_id) // init_id writes to temporary storage, so we need to materialize a temporary // for it. - MaterializeTemporary(context, init_id); + MaterializeTemporary(context, loc_id, init_id); } // If `expr_id` is an initializer, materializes it and returns the resulting // ephemeral reference expression. Otherwise, returns `expr_id`. -static auto MaterializeIfInitializer(Context& context, SemIR::InstId expr_id) - -> SemIR::InstId { +static auto MaterializeIfInitializer(Context& context, SemIR::LocId loc_id, + SemIR::InstId expr_id) -> SemIR::InstId { if (SemIR::IsInitializerCategory( SemIR::GetExprCategory(context.sem_ir(), expr_id))) { - return MaterializeTemporary(context, expr_id); + return MaterializeTemporary(context, loc_id, expr_id); } else { return expr_id; } @@ -407,14 +408,15 @@ static auto ConvertAggregateElement( // Performs a conversion from a tuple to an array type. This function only // converts the type, and does not perform a final conversion to the requested // expression category. -static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, +static auto ConvertTupleToArray(Context& context, SemIR::LocId loc_id, + SemIR::TupleType tuple_type, SemIR::ArrayType array_type, SemIR::InstId value_id, ConversionTarget target) -> SemIR::InstId { auto& sem_ir = context.sem_ir(); auto tuple_elem_types = sem_ir.inst_blocks().Get(tuple_type.type_elements_id); - SemIR::LocId value_loc_id(value_id); + auto value_loc_id = GetInstLocationOrFallback(context, value_id, loc_id); // If we're initializing from a tuple literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the @@ -422,7 +424,7 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, auto literal = GetAggregateLiteralElements(context, value_id); if (!literal.has_value()) { - value_id = MaterializeIfInitializer(context, value_id); + value_id = MaterializeIfInitializer(context, loc_id, value_id); } // Check that the tuple is the right size. @@ -522,7 +524,8 @@ static auto ConvertFunctionToCppPointer( // Performs a conversion from a tuple to a tuple type. This function only // converts the type, and does not perform a final conversion to the requested // expression category. -static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, +static auto ConvertTupleToTuple(Context& context, SemIR::LocId loc_id, + SemIR::TupleType src_type, SemIR::TupleType dest_type, SemIR::InstId value_id, ConversionTarget target) -> SemIR::InstId { @@ -530,7 +533,7 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, auto src_elem_types = sem_ir.inst_blocks().Get(src_type.type_elements_id); auto dest_elem_types = sem_ir.inst_blocks().Get(dest_type.type_elements_id); - SemIR::LocId value_loc_id(value_id); + auto value_loc_id = GetInstLocationOrFallback(context, value_id, loc_id); // If we're initializing from a tuple literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the @@ -538,7 +541,7 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, auto literal = GetAggregateLiteralElements(context, value_id); if (!literal.has_value()) { - value_id = MaterializeIfInitializer(context, value_id); + value_id = MaterializeIfInitializer(context, loc_id, value_id); } // Check that the tuples are the same size. @@ -763,10 +766,9 @@ static auto PerformVptrAccess(Context& context, SemIR::LocId loc_id, // Converts an initializer for a type `partial T` to an initializer for `T` by // initializing the vptr if necessary. static auto ConvertPartialInitializerToNonPartial( - Context& context, ConversionTarget target, + Context& context, SemIR::LocId loc_id, ConversionTarget target, SemIR::ClassType vtable_class_type, SemIR::InstId result_id) -> SemIR::InstId { - auto loc_id = SemIR::LocId(result_id); auto vptr_id = CreateVtablePtrRef(context, loc_id, vtable_class_type); if (!vptr_id.has_value()) { // No vtable pointer in this class, nothing to do. @@ -793,8 +795,9 @@ static auto ConvertPartialInitializerToNonPartial( // Common implementation for ConvertStructToStruct and ConvertStructToClass. template static auto ConvertStructToStructOrClass( - Context& context, SemIR::StructType src_type, SemIR::StructType dest_type, - SemIR::InstId value_id, ConversionTarget target, GetDefault get_default, + Context& context, SemIR::LocId loc_id, SemIR::StructType src_type, + SemIR::StructType dest_type, SemIR::InstId value_id, + ConversionTarget target, GetDefault get_default, SemIR::ClassType* vtable_class_type = nullptr) -> SemIR::InstId { static_assert(std::is_same_v || std::is_same_v); @@ -808,7 +811,7 @@ static auto ConvertStructToStructOrClass( auto dest_elem_fields_size = dest_elem_fields.size() - (dest_vptr_index.has_value() ? 1 : 0); - SemIR::LocId value_loc_id(value_id); + auto value_loc_id = GetInstLocationOrFallback(context, value_id, loc_id); // If we're initializing from a struct literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the @@ -816,7 +819,7 @@ static auto ConvertStructToStructOrClass( auto literal = GetAggregateLiteralElements(context, value_id); if (!literal.has_value()) { - value_id = MaterializeIfInitializer(context, value_id); + value_id = MaterializeIfInitializer(context, loc_id, value_id); } // Prepare to look up fields in the source by index. Also check for @@ -1001,7 +1004,7 @@ static auto ConvertStructToStructOrClass( .dest_id = target.storage_id}); if (vtable_class_type) { result_id = ConvertPartialInitializerToNonPartial( - context, target, *vtable_class_type, result_id); + context, value_loc_id, target, *vtable_class_type, result_id); } return result_id; } else if (is_init) { @@ -1020,32 +1023,35 @@ static auto ConvertStructToStructOrClass( // Performs a conversion from a struct to a struct type. This function only // converts the type, and does not perform a final conversion to the requested // expression category. -static auto ConvertStructToStruct(Context& context, SemIR::StructType src_type, +static auto ConvertStructToStruct(Context& context, SemIR::LocId loc_id, + SemIR::StructType src_type, SemIR::StructType dest_type, SemIR::InstId value_id, ConversionTarget target) -> SemIR::InstId { return ConvertStructToStructOrClass( - context, src_type, dest_type, value_id, target, + context, loc_id, src_type, dest_type, value_id, target, /*get_default=*/[](SemIR::NameId) { return SemIR::InstId::None; }); } // Performs a conversion from a struct to a class type. This function only // converts the type, and does not perform a final conversion to the requested // expression category. -static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, +static auto ConvertStructToClass(Context& context, SemIR::LocId loc_id, + SemIR::StructType src_type, SemIR::ClassType dest_type, SemIR::InstId value_id, ConversionTarget target, bool is_partial = false) -> SemIR::InstId { CARBON_CHECK(target.kind != ConversionTarget::InPlaceInitializing || target.storage_id.has_value()); + auto value_loc_id = GetInstLocationOrFallback(context, value_id, loc_id); PendingBlock target_block(&context); auto& dest_class_info = context.classes().Get(dest_type.class_id); if (!is_partial && dest_class_info.inheritance_kind == SemIR::Class::Abstract) { CARBON_DIAGNOSTIC(AbstractTypeInInit, Error, "initialization of abstract class {0}", SemIR::TypeId); - context.emitter().Emit(value_id, AbstractTypeInInit, target.type_id); + context.emitter().Emit(value_loc_id, AbstractTypeInInit, target.type_id); } auto object_repr_id = dest_class_info.GetObjectRepr(context.sem_ir(), dest_type.specific_id); @@ -1065,7 +1071,7 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, target.kind = ConversionTarget::Initializing; target.storage_access_block = &target_block; target.storage_id = target_block.AddInst( - SemIR::LocId(value_id), {.type_id = target.type_id}); + value_loc_id, {.type_id = target.type_id}); } const auto& dest_class_scope = @@ -1112,8 +1118,8 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, }; return ConvertStructToStructOrClass( - context, src_type, dest_struct_type, value_id, target, get_default, - is_partial ? nullptr : &dest_type); + context, loc_id, src_type, dest_struct_type, value_id, target, + get_default, is_partial ? nullptr : &dest_type); } // Represents an edge in the inheritance graph, created by a `base` declaration. @@ -1577,7 +1583,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, context.types().TryGetAs( unqual_target_type_id)) { value_id = ConvertPartialInitializerToNonPartial( - context, target, *target_class_type, value_id); + context, GetInstLocationOrFallback(context, value_id, loc_id), + target, *target_class_type, value_id); } } @@ -1617,8 +1624,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, if (auto target_tuple_type = target_type_inst.TryAs()) { if (auto src_tuple_type = sem_ir.types().TryGetAs(value_type_id)) { - return ConvertTupleToTuple(context, *src_tuple_type, *target_tuple_type, - value_id, target); + return ConvertTupleToTuple(context, loc_id, *src_tuple_type, + *target_tuple_type, value_id, target); } } @@ -1629,7 +1636,7 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, if (auto target_struct_type = target_type_inst.TryAs()) { if (auto src_struct_type = sem_ir.types().TryGetAs(value_type_id)) { - return ConvertStructToStruct(context, *src_struct_type, + return ConvertStructToStruct(context, loc_id, *src_struct_type, *target_struct_type, value_id, target); } } @@ -1647,8 +1654,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, sem_ir.types().TryGetAs(value_type_id)) { if (auto target_array_type = TryGetAsArrayType(context, loc_id, target.type_id)) { - return ConvertTupleToArray(context, *src_tuple_type, *target_array_type, - value_id, target); + return ConvertTupleToArray(context, loc_id, *src_tuple_type, + *target_array_type, value_id, target); } } @@ -1683,8 +1690,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, .Get(target_class_type->class_id) .adapt_id.has_value()) { return ConvertStructToClass( - context, *src_struct_type, *target_class_type, value_id, target, - target_quals.HasAnyOf(SemIR::TypeQualifiers::Partial)); + context, loc_id, *src_struct_type, *target_class_type, value_id, + target, target_quals.HasAnyOf(SemIR::TypeQualifiers::Partial)); } } } @@ -1857,11 +1864,13 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, // Given a value expression, form a corresponding initializer that copies from // that value to the specified target, if it is possible to do so. -static auto PerformCopy(Context& context, SemIR::InstId expr_id, - const ConversionTarget& target) -> SemIR::InstId { +static auto PerformCopy(Context& context, SemIR::LocId loc_id, + SemIR::InstId expr_id, const ConversionTarget& target) + -> SemIR::InstId { auto copy_id = BuildUnaryOperator( - context, SemIR::LocId(expr_id), {.interface_name = CoreIdentifier::Copy}, - expr_id, target.diagnose, [&](auto& builder) { + context, GetInstLocationOrFallback(context, expr_id, loc_id), + {.interface_name = CoreIdentifier::Copy}, expr_id, target.diagnose, + [&](auto& builder) { CARBON_DIAGNOSTIC_CONTEXT(CopyOfUncopyableType, "cannot copy value of type {0}", TypeOfInstId); @@ -1873,8 +1882,8 @@ static auto PerformCopy(Context& context, SemIR::InstId expr_id, // Tries to form a `ValueAsRef` conversion that extracts the pointer value from // a value expression with a pointer value representation. Returns the converted // expression, or None if the conversion was not applicable. -static auto TryMakeValueAsRef(Context& context, SemIR::InstId expr_id) - -> SemIR::InstId { +static auto TryMakeValueAsRef(Context& context, SemIR::LocId loc_id, + SemIR::InstId expr_id) -> SemIR::InstId { auto expr = context.insts().Get(expr_id); // If the expression has a pointer value representation, extract that and use @@ -1882,7 +1891,7 @@ static auto TryMakeValueAsRef(Context& context, SemIR::InstId expr_id) if (SemIR::ValueRepr::ForType(context.sem_ir(), expr.type_id()).kind == SemIR::ValueRepr::Pointer) { return AddInst( - context, SemIR::LocId(expr_id), + context, GetInstLocationOrFallback(context, expr_id, loc_id), {.type_id = expr.type_id(), .value_id = expr_id}); } @@ -2075,7 +2084,7 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, } if (target_.kind == ConversionTarget::Discarded) { - DiscardInitializer(context_, expr_id); + DiscardInitializer(context_, loc_id_, expr_id); return Done{expr_id}; } else if (IsValidExprCategoryForConversionTarget(category, target_.kind)) { @@ -2086,8 +2095,9 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // already a value representation. // TODO: If the target is DurableRef, materialize a VarStorage instead // of a TemporaryStorage to lifetime-extend. - return NextStep{.expr_id = MaterializeTemporary(context_, expr_id), - .category = SemIR::ExprCategory::EphemeralRef}; + return NextStep{ + .expr_id = MaterializeTemporary(context_, loc_id_, expr_id), + .category = SemIR::ExprCategory::EphemeralRef}; } case SemIR::ExprCategory::DurableRef: @@ -2110,10 +2120,11 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // If we have a reference and don't want one, form a value binding. // TODO: Support types with custom value representations. - return NextStep{.expr_id = AddInst( - context_, SemIR::LocId(expr_id), - {.type_id = target_.type_id, .value_id = expr_id}), - .category = SemIR::ExprCategory::Value}; + return NextStep{ + .expr_id = AddInst( + context_, GetInstLocationOrFallback(context_, expr_id, loc_id_), + {.type_id = target_.type_id, .value_id = expr_id}), + .category = SemIR::ExprCategory::Value}; case SemIR::ExprCategory::Value: if (target_.kind == ConversionTarget::DurableRef) { @@ -2141,7 +2152,7 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // When initializing a C++ thunk parameter, try to pass a value "by // reference". if (target_.kind == ConversionTarget::CppThunkRef) { - if (auto result_id = TryMakeValueAsRef(context_, expr_id); + if (auto result_id = TryMakeValueAsRef(context_, loc_id_, expr_id); result_id.has_value()) { return Done{result_id}; } @@ -2151,7 +2162,7 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // When initializing from a value, perform a copy. if (target_.is_initializer() || target_.kind == ConversionTarget::CppThunkRef) { - auto copy_id = PerformCopy(context_, expr_id, target_); + auto copy_id = PerformCopy(context_, loc_id_, expr_id, target_); if (copy_id == SemIR::ErrorInst::InstId) { return Done{SemIR::ErrorInst::InstId}; } @@ -2424,7 +2435,8 @@ auto PerformAction(Context& context, SemIR::SpecificId specific_id, if (!result_ids[next_result_index].has_value()) { result_ids[next_result_index] = AddInstInNoBlock( - context, SemIR::LocId(storage_arg_id), + context, + GetInstLocationOrFallback(context, storage_arg_id, loc_id), {.type_id = context.insts().Get(storage_arg_id).type_id()}); } ++next_result_index; @@ -2482,7 +2494,9 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, if (target.diagnose) { CARBON_DIAGNOSTIC(UseOfNonExprAsValue, Error, "expression cannot be used as a value"); - context.emitter().Emit(expr_id, UseOfNonExprAsValue); + context.emitter().Emit( + GetInstLocationOrFallback(context, expr_id, loc_id), + UseOfNonExprAsValue); } return SemIR::ErrorInst::InstId; } @@ -2499,7 +2513,9 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, if (target.diagnose) { CARBON_DIAGNOSTIC(RefTagNoRefParam, Error, "`ref` tag is not an argument to a `ref` parameter"); - context.emitter().Emit(expr_id, RefTagNoRefParam); + context.emitter().Emit( + GetInstLocationOrFallback(context, expr_id, loc_id), + RefTagNoRefParam); } return SemIR::ErrorInst::InstId; } @@ -2509,7 +2525,9 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, if (target.diagnose) { CARBON_DIAGNOSTIC(RefParamNoRefTag, Error, "argument to `ref` parameter not marked with `ref`"); - context.emitter().Emit(expr_id, RefParamNoRefTag); + context.emitter().Emit( + GetInstLocationOrFallback(context, expr_id, loc_id), + RefParamNoRefTag); } return SemIR::ErrorInst::InstId; } @@ -2706,7 +2724,8 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node, } // TODO: Consider moving this to pattern_match.h. -auto ConvertCallArgs(Context& context, SemIR::InstId self_id, +auto ConvertCallArgs(Context& context, SemIR::LocId loc_id, + SemIR::InstId self_id, llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, const SemIR::Function& callee, SemIR::SpecificId callee_specific_id, bool is_desugared) @@ -2721,9 +2740,10 @@ auto ConvertCallArgs(Context& context, SemIR::InstId self_id, !return_arg_id.has_value() || callee.call_param_ranges.return_size() > 0, "Return argument provided for a callee with no return parameter"); - return CallerPatternMatch(context, callee_specific_id, callee.self_param_id, - callee.param_patterns_id, callee.return_pattern_id, - self_id, arg_refs, return_arg_id, is_desugared); + return CallerPatternMatch(context, loc_id, callee_specific_id, + callee.self_param_id, callee.param_patterns_id, + callee.return_pattern_id, self_id, arg_refs, + return_arg_id, is_desugared); } auto TypeExpr::ForUnsugared(Context& context, SemIR::TypeId type_id) @@ -2860,7 +2880,7 @@ auto UnsafeUndoConvert(Context& context, SemIR::LocId loc_id, case SemIR::ExprCategory::DurableRef: break; case SemIR::ExprCategory::Value: - if (auto ref_expr_id = TryMakeValueAsRef(context, expr_id); + if (auto ref_expr_id = TryMakeValueAsRef(context, loc_id, expr_id); ref_expr_id.has_value()) { expr_id = ref_expr_id; } else { diff --git a/toolchain/check/convert.h b/toolchain/check/convert.h index 5ed45bb12c3a..e368e8755e87 100644 --- a/toolchain/check/convert.h +++ b/toolchain/check/convert.h @@ -209,7 +209,8 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node, // argument values for runtime parameters. `is_desugared` indicates that this // call was produced by desugaring, not written as a function call in user code, // so arguments to `ref` parameters aren't required to have `ref` tags. -auto ConvertCallArgs(Context& context, SemIR::InstId self_id, +auto ConvertCallArgs(Context& context, SemIR::LocId loc_id, + SemIR::InstId self_id, llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, const SemIR::Function& callee, SemIR::SpecificId callee_specific_id, bool is_desugared) diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 864b0b5c7a6a..7c95d81d1021 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -1844,8 +1844,9 @@ static auto CreateFunctionSignatureInsts( // C++ functions have no implicit parameters. Use `None` rather than an empty // block so that the signature matches a Carbon function with no implicit // parameter list. - auto match_results = CalleePatternMatch(context, SemIR::InstBlockId::None, - param_patterns_id, return_pattern_id); + auto match_results = + CalleePatternMatch(context, loc_id, SemIR::InstBlockId::None, + param_patterns_id, return_pattern_id); return {{.implicit_param_patterns_id = SemIR::InstBlockId::None, .param_patterns_id = param_patterns_id, diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index fa651e951b0b..257359714da7 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -166,7 +166,7 @@ static auto MakeFunctionSignature(Context& context, SemIR::LocId loc_id, } auto match_results = - CalleePatternMatch(context, insts.implicit_param_patterns_id, + CalleePatternMatch(context, loc_id, insts.implicit_param_patterns_id, insts.param_patterns_id, insts.return_pattern_id); insts.call_param_patterns_id = match_results.call_param_patterns_id; insts.call_params_id = match_results.call_params_id; @@ -479,7 +479,7 @@ auto SetDeducedReturnType(Context& context, SemIR::FunctionId function_id, } auto return_pattern_id = AddReturnPattern(context, loc_id, form); auto results = CalleeReturnPatternMatch( - context, + context, loc_id, {.call_param_patterns_id = function.call_param_patterns_id, .call_params_id = function.call_params_id, .param_ranges = function.call_param_ranges}, diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index a7ac0ef0ecfa..34e6bed16681 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -170,9 +170,9 @@ static auto PopImplIntroducerAndParamsAsNameComponent( .PopAndDiscardSoloNodeId(); // Emit the `forall` match. This shouldn't produce any valid `Call` params, // because `impl`s are never actually called at runtime. - auto match_results = - CalleePatternMatch(context, *implicit_param_patterns_id, - SemIR::InstBlockId::None, SemIR::InstId::None); + auto match_results = CalleePatternMatch( + context, implicit_params_loc_id, *implicit_param_patterns_id, + SemIR::InstBlockId::None, SemIR::InstId::None); CARBON_CHECK(match_results.call_params_id == SemIR::InstBlockId::Empty); CARBON_CHECK(match_results.call_param_patterns_id == SemIR::InstBlockId::Empty); diff --git a/toolchain/check/handle_lambda.cpp b/toolchain/check/handle_lambda.cpp index a5ef85290449..b1be626af776 100644 --- a/toolchain/check/handle_lambda.cpp +++ b/toolchain/check/handle_lambda.cpp @@ -61,7 +61,7 @@ auto HandleParseNode(Context& context, Parse::LambdaDefinitionStartId node_id) } auto match_results = - CalleePatternMatch(context, *implicit_param_patterns_id, + CalleePatternMatch(context, params_node_id, *implicit_param_patterns_id, *param_patterns_id, return_specifier.pattern_id); context.full_pattern_stack().PopFullPattern(); auto pattern_block_id = context.pattern_block_stack().Pop(); diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index a920aac16ffd..c15d211f91b0 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -330,7 +330,8 @@ auto HandleParseNode(Context& context, Parse::LetDeclId node_id) -> bool { /*is_definition=*/false); if (decl_info.init_id.has_value()) { - LocalPatternMatch(context, decl_info.pattern_id, decl_info.init_id); + LocalPatternMatch(context, node_id, decl_info.pattern_id, + decl_info.init_id); } else { CARBON_DIAGNOSTIC( ExpectedInitializerAfterLet, Error, @@ -418,7 +419,7 @@ auto HandleParseNode(Context& context, Parse::VariableDeclId node_id) -> bool { KeywordModifierSet::Returned | KeywordModifierSet::Static); - LocalPatternMatch(context, decl_info.pattern_id, decl_info.init_id); + LocalPatternMatch(context, node_id, decl_info.pattern_id, decl_info.init_id); auto pattern_block_id = context.pattern_block_stack().Pop(); if (!InNonStaticFieldDecl(context)) { diff --git a/toolchain/check/handle_loop_statement.cpp b/toolchain/check/handle_loop_statement.cpp index e13bf4ab5e90..a38e97310499 100644 --- a/toolchain/check/handle_loop_statement.cpp +++ b/toolchain/check/handle_loop_statement.cpp @@ -255,7 +255,7 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool { // Initialize the pattern from `.Get()`. auto element_value_id = CallOptionalAccessor(context, node_id, element_id, CoreIdentifier::Get); - LocalPatternMatch(context, pattern_id, element_value_id); + LocalPatternMatch(context, node_id, pattern_id, element_value_id); context.full_pattern_stack().PopFullPattern(); return true; } diff --git a/toolchain/check/inst.cpp b/toolchain/check/inst.cpp index 959dd874464c..2171e72a845e 100644 --- a/toolchain/check/inst.cpp +++ b/toolchain/check/inst.cpp @@ -306,4 +306,13 @@ auto BuildNameRef(Context& context, SemIR::LocId loc_id, SemIR::NameId name_id, {.type_id = type_id, .name_id = name_id, .value_id = new_inst_id}); } +auto GetInstLocationOrFallback(Context& context, SemIR::InstId inst_id, + SemIR::LocId fallback) -> SemIR::LocId { + auto loc_id = context.insts().GetCanonicalLocId(inst_id); + if (!loc_id.has_value()) { + loc_id = fallback; + } + return loc_id; +} + } // namespace Carbon::Check diff --git a/toolchain/check/inst.h b/toolchain/check/inst.h index 9aea8aff9599..6ff6edc18ebe 100644 --- a/toolchain/check/inst.h +++ b/toolchain/check/inst.h @@ -217,6 +217,12 @@ auto BuildNameRef(Context& context, SemIR::LocId loc_id, SemIR::NameId name_id, SemIR::InstId inst_id, SemIR::SpecificId specific_id) -> SemIR::InstId; +// Get a location to use in diagnostics from the `inst_id` if possible. If the +// instruction is canonical, then it has no location, and the `fallback` will be +// used instead. +auto GetInstLocationOrFallback(Context& context, SemIR::InstId inst_id, + SemIR::LocId fallback) -> SemIR::LocId; + } // namespace Carbon::Check #endif // CARBON_TOOLCHAIN_CHECK_INST_H_ diff --git a/toolchain/check/name_component.cpp b/toolchain/check/name_component.cpp index 04cbc30c189b..359a64188316 100644 --- a/toolchain/check/name_component.cpp +++ b/toolchain/check/name_component.cpp @@ -51,8 +51,9 @@ auto PopNameComponent(Context& context, SemIR::InstId return_pattern_id, auto pattern_block_id = SemIR::InstBlockId::None; if (param_patterns_id->has_value() || implicit_param_patterns_id->has_value() || has_return_specifier) { - auto results = CalleePatternMatch(context, *implicit_param_patterns_id, - *param_patterns_id, return_pattern_id); + auto results = + CalleePatternMatch(context, params_node_id, *implicit_param_patterns_id, + *param_patterns_id, return_pattern_id); call_param_patterns_id = results.call_param_patterns_id; call_params_id = results.call_params_id; param_ranges = results.param_ranges; diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index 36efd3cbc1a6..9ee455ed09ee 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -18,6 +18,7 @@ #include "toolchain/check/convert.h" #include "toolchain/check/eval.h" #include "toolchain/check/generic.h" +#include "toolchain/check/inst.h" #include "toolchain/check/pattern.h" #include "toolchain/check/type.h" #include "toolchain/diagnostics/format_providers.h" @@ -151,9 +152,9 @@ class MatchContext { // Constructs a MatchContext that uses the substituted constant values of // patterns in the given specific. - explicit MatchContext(Context& context, + explicit MatchContext(Context& context, SemIR::LocId loc_id, SemIR::SpecificId specific_id = SemIR::SpecificId::None) - : specific_id_stack_({specific_id}), context_(context) {} + : specific_id_stack_({specific_id}), context_(context), loc_id_(loc_id) {} // Performs pattern matching for the given work item. auto Match(State state, WorkItem entry) -> void; @@ -268,6 +269,7 @@ class MatchContext { llvm::SmallVector specific_id_stack_; Context& context_; + SemIR::LocId loc_id_; }; } // namespace @@ -491,7 +493,9 @@ auto MatchContext::DoPreWork(State state, SemIR::AnyParamPattern param_pattern, caller_state->call_args.push_back(SemIR::ErrorInst::InstId); } else { caller_state->call_args.push_back( - Convert(context_, SemIR::LocId(scrutinee_id), scrutinee_id, + Convert(context_, + GetInstLocationOrFallback(context_, scrutinee_id, loc_id_), + scrutinee_id, {.kind = ConversionKindFor(param_pattern, entry), .type_id = scrutinee_type_id})); } @@ -1080,7 +1084,7 @@ auto MatchContext::Dispatch(State state, WorkItem entry) -> void { } } -auto CalleePatternMatch(Context& context, +auto CalleePatternMatch(Context& context, SemIR::LocId loc_id, SemIR::InstBlockId implicit_param_patterns_id, SemIR::InstBlockId param_patterns_id, SemIR::InstId return_pattern_id) @@ -1093,7 +1097,7 @@ auto CalleePatternMatch(Context& context, } CalleeState state = {.index = IndexSource(SemIR::CallParamIndex(0))}; - MatchContext match(context); + MatchContext match(context, loc_id); // We add work to the stack in reverse so that the results will be produced // in the original order. @@ -1133,7 +1137,7 @@ auto CalleePatternMatch(Context& context, .param_ranges = {implicit_end, explicit_end, return_end}}; } -auto CalleeReturnPatternMatch(Context& context, +auto CalleeReturnPatternMatch(Context& context, SemIR::LocId loc_id, const CalleePatternMatchResults& param_results, SemIR::InstId return_pattern_id) -> CalleePatternMatchResults { @@ -1152,7 +1156,7 @@ auto CalleeReturnPatternMatch(Context& context, call_params.end()), .call_param_patterns = llvm::SmallVector( call_param_patterns.begin(), call_param_patterns.end())}; - MatchContext match(context); + MatchContext match(context, loc_id); match.Match(&state, {.pattern_id = return_pattern_id, .work = MatchContext::PreWork{.scrutinee_id = SemIR::InstId::None}}); @@ -1166,12 +1170,12 @@ auto CalleeReturnPatternMatch(Context& context, explicit_end, return_end}}; } -auto ThunkPatternMatch(Context& context, +auto ThunkPatternMatch(Context& context, SemIR::LocId loc_id, llvm::ArrayRef param_pattern_ids, llvm::ArrayRef outer_call_args) -> ThunkPatternMatchResults { ThunkState state = {.outer_call_args = outer_call_args}; - MatchContext match(context); + MatchContext match(context, loc_id); llvm::SmallVector inner_args; inner_args.reserve(outer_call_args.size()); @@ -1190,11 +1194,11 @@ auto ThunkPatternMatch(Context& context, // TODO: There is a cycle through pattern matching with an action. // NOLINTNEXTLINE(misc-no-recursion) -auto PerformAction(Context& context, SemIR::LocId /*loc_id*/, +auto PerformAction(Context& context, SemIR::LocId loc_id, SemIR::CallerPatternMatchAction action) -> SemIR::InstId { auto args = context.bundles().Get(action.args_id); CallerState state; - MatchContext match(context, args.callee_specific_id); + MatchContext match(context, loc_id, args.callee_specific_id); match.Match(&state, {.pattern_id = args.pattern_id, @@ -1208,11 +1212,11 @@ auto PerformAction(Context& context, SemIR::LocId /*loc_id*/, // TODO: There is a cycle through pattern matching with an action. // NOLINTNEXTLINE(misc-no-recursion) -auto PerformAction(Context& context, SemIR::LocId /*loc_id*/, +auto PerformAction(Context& context, SemIR::LocId loc_id, SemIR::CalleePatternMatchAction action) -> SemIR::InstId { auto args = context.bundles().Get(action.args_id); CalleeState state = {.index = IndexSource(args.parent_index)}; - MatchContext match(context); + MatchContext match(context, loc_id); auto result_id = match.MatchWithResult( &state, @@ -1224,16 +1228,14 @@ auto PerformAction(Context& context, SemIR::LocId /*loc_id*/, return result_id; } -auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, - SemIR::InstId self_pattern_id, - SemIR::InstBlockId param_patterns_id, - SemIR::InstId return_pattern_id, - SemIR::InstId self_arg_id, - llvm::ArrayRef arg_refs, - SemIR::InstId return_arg_id, bool is_desugared) - -> SemIR::InstBlockId { +auto CallerPatternMatch( + Context& context, SemIR::LocId loc_id, SemIR::SpecificId specific_id, + SemIR::InstId self_pattern_id, SemIR::InstBlockId param_patterns_id, + SemIR::InstId return_pattern_id, SemIR::InstId self_arg_id, + llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, + bool is_desugared) -> SemIR::InstBlockId { CallerState state; - MatchContext match(context, specific_id); + MatchContext match(context, loc_id, specific_id); // When we have a separate `self_arg_id`, we concatenate that onto the front // of the arg_refs to match against the first parameter. @@ -1278,10 +1280,11 @@ auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, return context.inst_blocks().Add(state.call_args); } -auto LocalPatternMatch(Context& context, SemIR::InstId pattern_id, - SemIR::InstId scrutinee_id) -> void { +auto LocalPatternMatch(Context& context, SemIR::LocId loc_id, + SemIR::InstId pattern_id, SemIR::InstId scrutinee_id) + -> void { LocalState state; - MatchContext match(context); + MatchContext match(context, loc_id); match.Match(&state, {.pattern_id = pattern_id, .work = MatchContext::PreWork{.scrutinee_id = scrutinee_id}}); diff --git a/toolchain/check/pattern_match.h b/toolchain/check/pattern_match.h index a6b6feb4e3ef..bfb094111932 100644 --- a/toolchain/check/pattern_match.h +++ b/toolchain/check/pattern_match.h @@ -40,7 +40,7 @@ struct CalleePatternMatchResults { // In some circumstances this can add new pattern insts, so the pattern // block containing the parameter patterns should still be on top of // `context.pattern_block_stack()`. -auto CalleePatternMatch(Context& context, +auto CalleePatternMatch(Context& context, SemIR::LocId loc_id, SemIR::InstBlockId implicit_param_patterns_id, SemIR::InstBlockId param_patterns_id, SemIR::InstId return_pattern_id) @@ -54,7 +54,7 @@ auto CalleePatternMatch(Context& context, // // As with `CalleePatternMatch`, the pattern block containing the return pattern // should be on top of `context.pattern_block_stack()`. -auto CalleeReturnPatternMatch(Context& context, +auto CalleeReturnPatternMatch(Context& context, SemIR::LocId loc_id, const CalleePatternMatchResults& param_results, SemIR::InstId return_pattern_id) -> CalleePatternMatchResults; @@ -74,7 +74,7 @@ struct ThunkPatternMatchResults { // Given the syntactic parameters and `Call` arguments for the outer part of a // thunked function call, computes the corresponding syntactic argument list, // suitable for passing to the inner part of the thunked function call. -auto ThunkPatternMatch(Context& context, +auto ThunkPatternMatch(Context& context, SemIR::LocId loc_id, llvm::ArrayRef param_pattern_ids, llvm::ArrayRef outer_call_args) -> ThunkPatternMatchResults; @@ -84,19 +84,18 @@ auto ThunkPatternMatch(Context& context, // be passed to the `Call` inst. `is_desugared` indicates that this call // was produced by desugaring, not written as a function call in user code, so // arguments to `ref` parameters aren't required to have `ref` tags. -auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, - SemIR::InstId self_pattern_id, - SemIR::InstBlockId param_patterns_id, - SemIR::InstId return_pattern_id, - SemIR::InstId self_arg_id, - llvm::ArrayRef arg_refs, - SemIR::InstId return_arg_id, bool is_desugared) - -> SemIR::InstBlockId; +auto CallerPatternMatch( + Context& context, SemIR::LocId loc_id, SemIR::SpecificId specific_id, + SemIR::InstId self_pattern_id, SemIR::InstBlockId param_patterns_id, + SemIR::InstId return_pattern_id, SemIR::InstId self_arg_id, + llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, + bool is_desugared) -> SemIR::InstBlockId; // Emits the pattern-match IR for a local pattern matching operation with the // given pattern and scrutinee. -auto LocalPatternMatch(Context& context, SemIR::InstId pattern_id, - SemIR::InstId scrutinee_id) -> void; +auto LocalPatternMatch(Context& context, SemIR::LocId loc_id, + SemIR::InstId pattern_id, SemIR::InstId scrutinee_id) + -> void; } // namespace Carbon::Check diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 879a969f0e27..6a2dea1e25b3 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -37,6 +37,20 @@ fn F(generic N: i32) { var unused arr: array(i32, N) = (1, 2, 3); } +// --- fail_init_dependent_bound_in_constant.carbon +library "[[@TEST_NAME]]"; + +interface Y(T: type, U: T) {} + +constraint Z(N: i32) { + // Forming the specific of `Y` uses constant values which are canonical and + // have no location. The error should still point somewhere reasonable. + // CHECK:STDERR: fail_init_dependent_bound_in_constant.carbon:[[@LINE+3]]:24-42: error: cannot initialize array with dependent bound from a list of initializers [ArrayInitDependentBound] + // CHECK:STDERR: fail_init_dependent_bound_in_constant.carbon:[[@LINE-6]]:1-28: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: + extend require impls Y(array((), N), ()); +} + // --- init_template_dependent_bound.carbon library "[[@TEST_NAME]]"; @@ -230,10 +244,23 @@ fn H() { G(3); } // CHECK:STDOUT: %.c23: %.8cb = splice_inst @G.%.loc6_3.8 [template] // CHECK:STDOUT: %.57c: type = type_of_inst @G.%.loc6_3.11 [template] // CHECK:STDOUT: %.e63: %.57c = splice_inst @G.%.loc6_3.11 [template] +// CHECK:STDOUT: %ImplicitAs.type.6b0: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6 = struct_value () [symbolic] // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.5be: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.dfd: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.914: %Int.as.ImplicitAs.impl.Convert.type.dfd = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.impl_witness.d73: = impl_witness imports.%ImplicitAs.impl_witness_table.f53, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.fc6: %ImplicitAs.type.6b0 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.d73) [concrete] +// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.58f: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet.fc6) [concrete] +// CHECK:STDOUT: %.33a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.58f, %ImplicitAs.facet.fc6 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.fb0: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.9f3: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.323: = impl_witness imports.%ImplicitAs.impl_witness_table.b7c, @Int.as.ImplicitAs.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.f39: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete] @@ -267,14 +294,47 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt.403: %pattern_type.d4e = ref_binding_pattern arr [concrete] // CHECK:STDOUT: %arr.var_patt.074: %pattern_type.d4e = var_pattern %arr.patt.403 [concrete] // CHECK:STDOUT: %int_0.5c61a1.1: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282: = bound_method %int_1.5b8115.1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] +// CHECK:STDOUT: %bound_method.3bd: = bound_method %int_1.5b8115.1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.68a: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6: = bound_method %int_2.ecc8af.1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] +// CHECK:STDOUT: %bound_method.a55: = bound_method %int_2.ecc8af.1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.2e0: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %array: %Array.95c1f3.1 = tuple_value (%int_1.68a, %int_2.2e0, %int_3.9f3) [concrete] // CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { -// CHECK:STDOUT: %.220: init %Array.95c1f3.1 = splice_block %.0a1 [concrete = %array] { -// CHECK:STDOUT: +// CHECK:STDOUT: %.e8f: init %Array.95c1f3.1 = splice_block %.0a1 [concrete = %array] { +// CHECK:STDOUT: %tuple.elem0: Core.IntLiteral = tuple_access %tuple.2d5, element0 [concrete = %int_1.5b8115.1] +// CHECK:STDOUT: %impl.elem0.5f53f7.1: %.33a = impl_witness_access %ImplicitAs.impl_witness.d73, element0 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.273: = bound_method %tuple.elem0, %impl.elem0.5f53f7.1 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282] +// CHECK:STDOUT: %specific_fn.54a37f.1: = specific_function %impl.elem0.5f53f7.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.109: = bound_method %tuple.elem0, %specific_fn.54a37f.1 [concrete = %bound_method.3bd] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.84a: init %i32 = call %bound_method.109(%tuple.elem0) [concrete = %int_1.68a] +// CHECK:STDOUT: %.64d: init %i32 = converted %tuple.elem0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.84a [concrete = %int_1.68a] // CHECK:STDOUT: %.202040.2: ref %Array.95c1f3.1 = specific_inst @G.%arr.var, @G(%int_3.9f3) -// CHECK:STDOUT: +// CHECK:STDOUT: %int_0.5c61a1.2: Core.IntLiteral = int_value 0 [concrete = %int_0.5c61a1.1] +// CHECK:STDOUT: %.1c0: ref %i32 = array_index %.202040.2, %int_0.5c61a1.2 +// CHECK:STDOUT: %.e90: init %i32 to %.1c0 = in_place_init %.64d [concrete = %int_1.68a] +// CHECK:STDOUT: %tuple.elem1: Core.IntLiteral = tuple_access %tuple.2d5, element1 [concrete = %int_2.ecc8af.1] +// CHECK:STDOUT: %impl.elem0.5f53f7.2: %.33a = impl_witness_access %ImplicitAs.impl_witness.d73, element0 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.166: = bound_method %tuple.elem1, %impl.elem0.5f53f7.2 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6] +// CHECK:STDOUT: %specific_fn.54a37f.2: = specific_function %impl.elem0.5f53f7.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.1fb: = bound_method %tuple.elem1, %specific_fn.54a37f.2 [concrete = %bound_method.a55] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.acf: init %i32 = call %bound_method.1fb(%tuple.elem1) [concrete = %int_2.2e0] +// CHECK:STDOUT: %.081: init %i32 = converted %tuple.elem1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.acf [concrete = %int_2.2e0] +// CHECK:STDOUT: %int_1.5b8115.2: Core.IntLiteral = int_value 1 [concrete = %int_1.5b8115.1] +// CHECK:STDOUT: %.873: ref %i32 = array_index %.202040.2, %int_1.5b8115.2 +// CHECK:STDOUT: %.ee8: init %i32 to %.873 = in_place_init %.081 [concrete = %int_2.2e0] +// CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %tuple.2d5, element2 [concrete = %int_3.1ba] +// CHECK:STDOUT: %impl.elem0.5f53f7.3: %.33a = impl_witness_access %ImplicitAs.impl_witness.d73, element0 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.44f: = bound_method %tuple.elem2, %impl.elem0.5f53f7.3 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c] +// CHECK:STDOUT: %specific_fn.54a37f.3: = specific_function %impl.elem0.5f53f7.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.f04: = bound_method %tuple.elem2, %specific_fn.54a37f.3 [concrete = %bound_method.fb0] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.44c: init %i32 = call %bound_method.f04(%tuple.elem2) [concrete = %int_3.9f3] +// CHECK:STDOUT: %.1ac: init %i32 = converted %tuple.elem2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.44c [concrete = %int_3.9f3] +// CHECK:STDOUT: %int_2.ecc8af.2: Core.IntLiteral = int_value 2 [concrete = %int_2.ecc8af.1] +// CHECK:STDOUT: %.ea8: ref %i32 = array_index %.202040.2, %int_2.ecc8af.2 +// CHECK:STDOUT: %.823: init %i32 to %.ea8 = in_place_init %.1ac [concrete = %int_3.9f3] +// CHECK:STDOUT: %.0a1: init %Array.95c1f3.1 to %.202040.2 = array_init (%.e90, %.ee8, %.823) [concrete = %array] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %tuple.242: %tuple.type.f7a = tuple_value (%inst.splice_block.426619.3) [concrete] @@ -312,6 +372,8 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.df0: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.869) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.c97)] +// CHECK:STDOUT: %Core.import_ref.e47: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.f53 = impl_witness_table (%Core.import_ref.e47), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.import_ref.ed0: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.dfd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.914)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b7c = impl_witness_table (%Core.import_ref.ed0), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index 324c5cd72f75..968b8f4db401 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -1063,7 +1063,7 @@ fn G() { F({}); } // CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.0ef: init %C.664bb6.1 = splice_block %.5cd [concrete = %C.val] { // CHECK:STDOUT: %.ed1955.2: ref %C.664bb6.1 = specific_inst @F.%v.var, @F(%empty_struct_type) -// CHECK:STDOUT: +// CHECK:STDOUT: %.5cd: init %C.664bb6.1 to %.ed1955.2 = class_init () [concrete = %C.val] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.2) [concrete] diff --git a/toolchain/check/testdata/class/method/virtual.carbon b/toolchain/check/testdata/class/method/virtual.carbon index 2d645215ce5b..a76a5eb38b6d 100644 --- a/toolchain/check/testdata/class/method/virtual.carbon +++ b/toolchain/check/testdata/class/method/virtual.carbon @@ -396,8 +396,6 @@ class D1 { } // --- fail_impl_generic_specifically_mismatch.carbon -// CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon: error: cannot implicitly convert expression of type `T1*` to `T2*` [ConversionFailure] -// CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon: note: type `T1*` does not implement interface `Core.ImplicitAs(T2*)` [MissingImplInMemberAccessInContext] library "[[@TEST_NAME]]"; @@ -410,15 +408,15 @@ base class Base(T: type) { class D1 { extend base: Base(T1); + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+5]]:3-45: error: cannot implicitly convert expression of type `T1*` to `T2*` [ConversionFailure] + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+4]]:3-45: note: type `T1*` does not implement interface `Core.ImplicitAs(T2*)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+3]]:37-42: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE-6]]:3-44: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE-8]]:3-44: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: override fn F(unused self, unused t: T2*) { } } // --- fail_impl_generic_generic_mismatch.carbon -// CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon: error: cannot implicitly convert expression of type `T*` to `T` [ConversionFailure] -// CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon: note: type `T*` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessInContext] library "[[@TEST_NAME]]"; @@ -427,8 +425,10 @@ abstract class Base(T: type) { } class Derived(T: type) { extend base: Base(T); + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+5]]:3-43: error: cannot implicitly convert expression of type `T*` to `T` [ConversionFailure] + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+4]]:3-43: note: type `T*` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+3]]:37-40: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE-5]]:3-43: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE-7]]:3-43: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: override fn F(unused self, unused t: T) { } } @@ -803,11 +803,11 @@ class T2(G2: type) { // CHECK:STDOUT: override fn @Derived.H.loc9_22.2(%self.param: %Base) [thunk @Derived.%Derived.H.decl.loc9_22.1 for imports.%Base.H.decl] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %H.ref: %Derived.H.type.1f42d4.1 = name_ref H, @Derived.%Derived.H.decl.loc9_22.1 [concrete = constants.%Derived.H.a6796b.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc9_22.1: ref %Derived = enclosing_class_access %.2, element0 -// CHECK:STDOUT: %.loc9_22.2: %Derived = acquire_value %.loc9_22.1 -// CHECK:STDOUT: %Derived.H.bound: = bound_method %.loc9_22.2, %H.ref -// CHECK:STDOUT: %Derived.H.call: init %empty_tuple.type = call %Derived.H.bound(%.loc9_22.2) +// CHECK:STDOUT: %.loc9_22.1: ref %Base = value_as_ref %self.param +// CHECK:STDOUT: %.loc9_22.2: ref %Derived = enclosing_class_access %.loc9_22.1, element0 +// CHECK:STDOUT: %.loc9_22.3: %Derived = acquire_value %.loc9_22.2 +// CHECK:STDOUT: %Derived.H.bound: = bound_method %.loc9_22.3, %H.ref +// CHECK:STDOUT: %Derived.H.call: init %empty_tuple.type = call %Derived.H.bound(%.loc9_22.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1446,12 +1446,12 @@ class T2(G2: type) { // CHECK:STDOUT: override fn @Derived.F.loc15_22.2(%self.param: %AbstractBase) [thunk @Derived.%Derived.F.decl.loc15_22.1 for @AbstractBase.%AbstractBase.F.decl] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc15_22.1: ref %AbstractIntermediate = enclosing_class_access %.2, element0 -// CHECK:STDOUT: %.loc15_22.2: ref %Derived = enclosing_class_access %.loc15_22.1, element0 -// CHECK:STDOUT: %.loc15_22.3: %Derived = acquire_value %.loc15_22.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.3, %F.ref -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.3) +// CHECK:STDOUT: %.loc15_22.1: ref %AbstractBase = value_as_ref %self.param +// CHECK:STDOUT: %.loc15_22.2: ref %AbstractIntermediate = enclosing_class_access %.loc15_22.1, element0 +// CHECK:STDOUT: %.loc15_22.3: ref %Derived = enclosing_class_access %.loc15_22.2, element0 +// CHECK:STDOUT: %.loc15_22.4: %Derived = acquire_value %.loc15_22.3 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.4, %F.ref +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1518,12 +1518,12 @@ class T2(G2: type) { // CHECK:STDOUT: override fn @Derived.F.loc15_22.2(%self.param: %VirtualBase) [thunk @Derived.%Derived.F.decl.loc15_22.1 for @VirtualBase.%VirtualBase.F.decl] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc15_22.1: ref %VirtualIntermediate = enclosing_class_access %.2, element0 -// CHECK:STDOUT: %.loc15_22.2: ref %Derived = enclosing_class_access %.loc15_22.1, element0 -// CHECK:STDOUT: %.loc15_22.3: %Derived = acquire_value %.loc15_22.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.3, %F.ref -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.3) +// CHECK:STDOUT: %.loc15_22.1: ref %VirtualBase = value_as_ref %self.param +// CHECK:STDOUT: %.loc15_22.2: ref %VirtualIntermediate = enclosing_class_access %.loc15_22.1, element0 +// CHECK:STDOUT: %.loc15_22.3: ref %Derived = enclosing_class_access %.loc15_22.2, element0 +// CHECK:STDOUT: %.loc15_22.4: %Derived = acquire_value %.loc15_22.3 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.4, %F.ref +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1641,22 +1641,22 @@ class T2(G2: type) { // CHECK:STDOUT: override fn @Derived.F.loc23(%self.param: %Base) -> out %return.param: %T1 [thunk @Derived.%Derived.F.decl.loc23_28.1 for @Base.%Base.F.decl] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc23_28.1 [concrete = constants.%Derived.F.bd5be1.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc23_28.1: ref %Derived = enclosing_class_access %.3, element0 -// CHECK:STDOUT: %.loc23_28.2: %Derived = acquire_value %.loc23_28.1 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc23_28.2, %F.ref -// CHECK:STDOUT: %.loc23_28.3: ref %T2 = temporary_storage -// CHECK:STDOUT: %Derived.F.call: init %T2 to %.loc23_28.3 = call %Derived.F.bound(%.loc23_28.2) +// CHECK:STDOUT: %.loc23_28.1: ref %Base = value_as_ref %self.param +// CHECK:STDOUT: %.loc23_28.2: ref %Derived = enclosing_class_access %.loc23_28.1, element0 +// CHECK:STDOUT: %.loc23_28.3: %Derived = acquire_value %.loc23_28.2 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc23_28.3, %F.ref +// CHECK:STDOUT: %.loc23_28.4: ref %T2 = temporary_storage +// CHECK:STDOUT: %Derived.F.call: init %T2 to %.loc23_28.4 = call %Derived.F.bound(%.loc23_28.3) // CHECK:STDOUT: %impl.elem0: %.321 = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%T2.as.ImplicitAs.impl.Convert] // CHECK:STDOUT: %bound_method: = bound_method %Derived.F.call, %impl.elem0 // CHECK:STDOUT: -// CHECK:STDOUT: %.loc23_28.4: ref %T2 = temporary %.loc23_28.3, %Derived.F.call -// CHECK:STDOUT: %.loc23_28.5: %T2 = acquire_value %.loc23_28.4 -// CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.call: init %T1 to %.4 = call %bound_method(%.loc23_28.5) -// CHECK:STDOUT: %.loc23_28.6: init %T1 = converted %Derived.F.call, %T2.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc23_28.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc23_28.4) -// CHECK:STDOUT: return %.loc23_28.6 to %return.param +// CHECK:STDOUT: %.loc23_28.5: ref %T2 = temporary %.loc23_28.4, %Derived.F.call +// CHECK:STDOUT: %.loc23_28.6: %T2 = acquire_value %.loc23_28.5 +// CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.call: init %T1 to %.3 = call %bound_method(%.loc23_28.6) +// CHECK:STDOUT: %.loc23_28.7: init %T1 = converted %Derived.F.call, %T2.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc23_28.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc23_28.5) +// CHECK:STDOUT: return %.loc23_28.7 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_28.1(%self.param: ref %empty_struct_type) = "no_op"; @@ -1955,11 +1955,11 @@ class T2(G2: type) { // CHECK:STDOUT: override fn @D1.F.loc11_51.2(%self.param: %Base.fe7, %t.param: %ptr.3f4) [thunk @D1.%D1.F.decl.loc11_51.1 for @Base.%Base.F.decl, @Base.F(constants.%T1)] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %D1.F.type.48cdab.1 = name_ref F, @D1.%D1.F.decl.loc11_51.1 [concrete = constants.%D1.F.bd5be1.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc11_51.1: ref %D1 = enclosing_class_access %.3, element0 -// CHECK:STDOUT: %.loc11_51.2: %D1 = acquire_value %.loc11_51.1 -// CHECK:STDOUT: %D1.F.bound: = bound_method %.loc11_51.2, %F.ref -// CHECK:STDOUT: %D1.F.call: init %empty_tuple.type = call %D1.F.bound(%.loc11_51.2, %t.param) +// CHECK:STDOUT: %.loc11_51.1: ref %Base.fe7 = value_as_ref %self.param +// CHECK:STDOUT: %.loc11_51.2: ref %D1 = enclosing_class_access %.loc11_51.1, element0 +// CHECK:STDOUT: %.loc11_51.3: %D1 = acquire_value %.loc11_51.2 +// CHECK:STDOUT: %D1.F.bound: = bound_method %.loc11_51.3, %F.ref +// CHECK:STDOUT: %D1.F.call: init %empty_tuple.type = call %D1.F.bound(%.loc11_51.3, %t.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2094,13 +2094,13 @@ class T2(G2: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_44.1: @Derived.F.loc10_44.2.%Derived.F.type (%Derived.F.type.c2528c.1) = specific_constant @Derived.%Derived.F.decl.loc10_44.1, @Derived(constants.%T) [symbolic = %Derived.F (constants.%Derived.F.768a1f.1)] // CHECK:STDOUT: %F.ref: @Derived.F.loc10_44.2.%Derived.F.type (%Derived.F.type.c2528c.1) = name_ref F, %.loc10_44.1 [symbolic = %Derived.F (constants.%Derived.F.768a1f.1)] -// CHECK:STDOUT: -// CHECK:STDOUT: %.loc10_44.2: ref @Derived.F.loc10_44.2.%Derived (%Derived) = enclosing_class_access %.5, element0 -// CHECK:STDOUT: %.loc10_44.3: @Derived.F.loc10_44.2.%Derived (%Derived) = acquire_value %.loc10_44.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc10_44.3, %F.ref +// CHECK:STDOUT: %.loc10_44.2: ref @Derived.F.loc10_44.2.%Base (%Base.c50) = value_as_ref %self.param +// CHECK:STDOUT: %.loc10_44.3: ref @Derived.F.loc10_44.2.%Derived (%Derived) = enclosing_class_access %.loc10_44.2, element0 +// CHECK:STDOUT: %.loc10_44.4: @Derived.F.loc10_44.2.%Derived (%Derived) = acquire_value %.loc10_44.3 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc10_44.4, %F.ref // CHECK:STDOUT: %Derived.F.specific_fn.loc10_44.1: = specific_function %F.ref, @Derived.F.loc10_44.1(constants.%T) [symbolic = %Derived.F.specific_fn.loc10_44.2 (constants.%Derived.F.specific_fn.75d496.2)] -// CHECK:STDOUT: %bound_method: = bound_method %.loc10_44.3, %Derived.F.specific_fn.loc10_44.1 -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %bound_method(%.loc10_44.3, %t.param) +// CHECK:STDOUT: %bound_method: = bound_method %.loc10_44.4, %Derived.F.specific_fn.loc10_44.1 +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %bound_method(%.loc10_44.4, %t.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index f41d0fdf9e4b..3bcfadcdb5c4 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -194,7 +194,7 @@ fn H() { // CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.dbd: init %C = splice_block %.b84 [concrete = %C.val] { // CHECK:STDOUT: %.ddc4c9.2: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.9f3) -// CHECK:STDOUT: +// CHECK:STDOUT: %.b84: init %C to %.ddc4c9.2 = class_init () [concrete = %C.val] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %tuple.242: %tuple.type.f7a = tuple_value (%inst.splice_block.426619.1) [concrete] diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 3068ac75eeda..0453753dac52 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -42,7 +42,7 @@ fn G(generic B: bool) { // TODO: Provide a location for the "cannot initialize" error message. fn H() { // CHECK:STDERR: fail_symbolic_call_to_eval_fn_invalid_instantiation.carbon:[[@LINE+3]]:3: error: unable to monomorphize specific `G(true)` [ResolvingSpecificHere] - // CHECK:STDERR: fail_symbolic_call_to_eval_fn_invalid_instantiation.carbon: note: cannot initialize tuple of 0 elements from tuple with 2 elements [TupleInitElementCountMismatch] + // CHECK:STDERR: fail_symbolic_call_to_eval_fn_invalid_instantiation.carbon:[[@LINE-6]]:24-31: note: cannot initialize tuple of 0 elements from tuple with 2 elements [TupleInitElementCountMismatch] // CHECK:STDERR: G(true); } diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index cb3a4fa5eb6b..f5d036de6960 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -83,29 +83,29 @@ class FMissingImplicitParam { class FMissingReturnType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5-30: error: cannot implicitly convert expression of type `()` to `bool` [ConversionFailure] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:5-30: note: type `()` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-30: error: cannot implicitly convert expression of type `()` to `bool` [ConversionFailure] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:5-30: note: type `()` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-25]]:15-48: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: error: cannot implicitly convert expression of type `bool` to `FDifferentParamType` [ConversionFailure] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentParamType)` [MissingImplInMemberAccessInContext] fn F(self: bool, b: bool); } } class FDifferentParamType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:22-28: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:5-38: error: cannot implicitly convert expression of type `bool` to `FDifferentParamType` [ConversionFailure] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-38: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentParamType)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:22-28: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-36]]:15-48: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: error: cannot implicitly convert expression of type `bool` to `FDifferentImplicitParamType` [ConversionFailure] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentImplicitParamType)` [MissingImplInMemberAccessInContext] fn F(self: bool, b: Self) -> bool; } } class FDifferentImplicitParamType { impl as J { + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:5-32: error: cannot implicitly convert expression of type `bool` to `FDifferentImplicitParamType` [ConversionFailure] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-32: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentImplicitParamType)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:10-13: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15-48: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: @@ -116,12 +116,10 @@ class FDifferentImplicitParamType { class FDifferentReturnType { impl as J { // TODO: Include an "aka" in this diagnostic to explain that the type `Self` is `FDifferentReturnType`. - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5-38: error: cannot implicitly convert expression of type `Self` to `bool` [ConversionFailure] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:5-38: note: type `FDifferentReturnType` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-38: error: cannot implicitly convert expression of type `Self` to `bool` [ConversionFailure] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:5-38: note: type `FDifferentReturnType` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-58]]:15-48: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: error: cannot implicitly convert expression of type `SelfNestedBadParam` to `i32` [ConversionFailure] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon: note: type `SelfNestedBadParam` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext] fn F(self: bool, b: bool) -> Self; } } @@ -132,8 +130,10 @@ interface SelfNested { class SelfNestedBadParam { impl as SelfNested { + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+5]]:5-87: error: cannot implicitly convert expression of type `SelfNestedBadParam` to `i32` [ConversionFailure] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-87: note: type `SelfNestedBadParam` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:10-53: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:3-58: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:3-58: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> array(SelfNestedBadParam, 4); } @@ -143,7 +143,7 @@ class SelfNestedBadReturnType { impl as SelfNested { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+4]]:5-112: error: cannot implicitly convert expression of type `array(SelfNestedBadParam, 4)` to `array(SelfNestedBadReturnType, 4)` [ConversionFailure] // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+3]]:5-112: note: type `array(SelfNestedBadParam, 4)` does not implement interface `Core.ImplicitAs(array(SelfNestedBadReturnType, 4))` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-16]]:3-58: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:3-58: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> array(SelfNestedBadParam, 4); } @@ -244,38 +244,28 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [concrete] // CHECK:STDOUT: %.199: = impl_self_witness %FMissingReturnType, @J [concrete] // CHECK:STDOUT: %J.impl_witness.50a: = impl_witness @FMissingReturnType.as.J.impl.%J.impl_witness_table [concrete] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.1: type = fn_type @FMissingReturnType.as.J.impl.F.loc92_30.1 [concrete] +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.1: type = fn_type @FMissingReturnType.as.J.impl.F.loc90_30.1 [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.6975be.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.b68: %J.type = facet_value %FMissingReturnType, (%J.impl_witness.50a) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.628: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.b68) [concrete] // CHECK:STDOUT: %J.WithSelf.F.70e: %J.WithSelf.F.type.628 = struct_value () [concrete] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.2: type = fn_type @FMissingReturnType.as.J.impl.F.loc92_30.2 [concrete] +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.2: type = fn_type @FMissingReturnType.as.J.impl.F.loc90_30.2 [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.6975be.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.b02: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.862: %ImplicitAs.type.b02 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type.07d: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.eae: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.862) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.699: %ImplicitAs.WithSelf.Convert.type.eae = struct_value () [symbolic] -// CHECK:STDOUT: %assoc0.3a5: %ImplicitAs.assoc_type.07d = assoc_entity element0, imports.%Core.import_ref.9e1 [symbolic] // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [concrete] // CHECK:STDOUT: %.593: = impl_self_witness %FDifferentParamType, @J [concrete] // CHECK:STDOUT: %J.impl_witness.9e2: = impl_witness @FDifferentParamType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.5d3: type = pattern_type %FDifferentParamType [concrete] // CHECK:STDOUT: %b.param_patt.0a8: %pattern_type.5d3 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt.f7e: %pattern_type.5d3 = wrapper_binding_pattern b, %b.param_patt.0a8 [concrete] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1: type = fn_type @FDifferentParamType.as.J.impl.F.loc103_38.1 [concrete] +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1: type = fn_type @FDifferentParamType.as.J.impl.F.loc101_38.1 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.28602a.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.73e: %J.type = facet_value %FDifferentParamType, (%J.impl_witness.9e2) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.fec: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.73e) [concrete] // CHECK:STDOUT: %J.WithSelf.F.236: %J.WithSelf.F.type.fec = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2: type = fn_type @FDifferentParamType.as.J.impl.F.loc103_38.2 [concrete] +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2: type = fn_type @FDifferentParamType.as.J.impl.F.loc101_38.2 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.28602a.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.85e: type = facet_type <@ImplicitAs, @ImplicitAs(%FDifferentParamType)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.a99: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%FDifferentParamType) [concrete] -// CHECK:STDOUT: %assoc0.8f3: %ImplicitAs.assoc_type.a99 = assoc_entity element0, imports.%Core.import_ref.a03 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [concrete] // CHECK:STDOUT: %.46c: = impl_self_witness %FDifferentImplicitParamType, @J [concrete] // CHECK:STDOUT: %J.impl_witness.d1a: = impl_witness @FDifferentImplicitParamType.as.J.impl.%J.impl_witness_table [concrete] @@ -289,9 +279,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %J.WithSelf.F.a0b: %J.WithSelf.F.type.fa8 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc112_32.2 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.792c78.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.444: type = facet_type <@ImplicitAs, @ImplicitAs(%FDifferentImplicitParamType)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.884: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%FDifferentImplicitParamType) [concrete] -// CHECK:STDOUT: %assoc0.cb0: %ImplicitAs.assoc_type.884 = assoc_entity element0, imports.%Core.import_ref.a03 [concrete] // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [concrete] // CHECK:STDOUT: %.ce7: = impl_self_witness %FDifferentReturnType, @J [concrete] // CHECK:STDOUT: %J.impl_witness.6a4: = impl_witness @FDifferentReturnType.as.J.impl.%J.impl_witness_table [concrete] @@ -299,12 +286,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.b9f: type = pattern_type %FDifferentReturnType [concrete] // CHECK:STDOUT: %return.param_patt.f37: %pattern_type.b9f = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.e4f: %pattern_type.b9f = return_slot_pattern %return.param_patt.f37, %FDifferentReturnType [concrete] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1: type = fn_type @FDifferentReturnType.as.J.impl.F.loc125_38.1 [concrete] +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1: type = fn_type @FDifferentReturnType.as.J.impl.F.loc123_38.1 [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.9725a5.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.6a7: %J.type = facet_value %FDifferentReturnType, (%J.impl_witness.6a4) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.b41: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.6a7) [concrete] // CHECK:STDOUT: %J.WithSelf.F.982: %J.WithSelf.F.type.b41 = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2: type = fn_type @FDifferentReturnType.as.J.impl.F.loc125_38.2 [concrete] +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2: type = fn_type @FDifferentReturnType.as.J.impl.F.loc123_38.2 [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.9725a5.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [concrete] // CHECK:STDOUT: %Self.e81: %SelfNested.type = symbolic_binding Self, 0 [symbolic] @@ -361,9 +348,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %x.patt.79a: %pattern_type.1ec = wrapper_binding_pattern x, %x.param_patt.255 [concrete] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc138_87.2 [concrete] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.5fd896.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.6b0: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.4ac: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %assoc0.689: %ImplicitAs.assoc_type.4ac = assoc_entity element0, imports.%Core.import_ref.a03 [concrete] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [concrete] // CHECK:STDOUT: %.020: = impl_self_witness %SelfNestedBadReturnType, @SelfNested [concrete] // CHECK:STDOUT: %SelfNested.impl_witness.849: = impl_witness @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNested.impl_witness_table [concrete] @@ -399,9 +383,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.383: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.07d) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%assoc0 (constants.%assoc0.3a5)] -// CHECK:STDOUT: %Core.import_ref.a03: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.eae) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.699)] -// CHECK:STDOUT: %Core.import_ref.9e1 = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Array: %Array.type = import_ref Core//prelude/parts/array, Array, loaded [concrete = constants.%Array.generic] // CHECK:STDOUT: } @@ -501,34 +482,34 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %SelfNested.WithSelf.F.decl: @SelfNested.WithSelf.%SelfNested.WithSelf.F.type (%SelfNested.WithSelf.F.type.3a1) = fn_decl @SelfNested.WithSelf.F [symbolic = @SelfNested.WithSelf.%SelfNested.WithSelf.F (constants.%SelfNested.WithSelf.F.796)] { -// CHECK:STDOUT: %x.param_patt.loc130_9.1: @SelfNested.WithSelf.F.%pattern_type.loc130_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc130_9.2 (constants.%x.param_patt.8f6)] -// CHECK:STDOUT: %x.patt.loc130_9.1: @SelfNested.WithSelf.F.%pattern_type.loc130_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc130_9.1 [symbolic = %x.patt.loc130_9.2 (constants.%x.patt.48b)] -// CHECK:STDOUT: %return.param_patt.loc130_57.1: @SelfNested.WithSelf.F.%pattern_type.loc130_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc130_57.2 (constants.%return.param_patt.36b)] -// CHECK:STDOUT: %return.patt.loc130_41.1: @SelfNested.WithSelf.F.%pattern_type.loc130_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc130_57.1, %Array.loc130_57.2 [symbolic = %return.patt.loc130_41.2 (constants.%return.patt.7a8)] +// CHECK:STDOUT: %x.param_patt.loc128_9.1: @SelfNested.WithSelf.F.%pattern_type.loc128_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc128_9.2 (constants.%x.param_patt.8f6)] +// CHECK:STDOUT: %x.patt.loc128_9.1: @SelfNested.WithSelf.F.%pattern_type.loc128_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc128_9.1 [symbolic = %x.patt.loc128_9.2 (constants.%x.patt.48b)] +// CHECK:STDOUT: %return.param_patt.loc128_57.1: @SelfNested.WithSelf.F.%pattern_type.loc128_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc128_57.2 (constants.%return.param_patt.36b)] +// CHECK:STDOUT: %return.patt.loc128_41.1: @SelfNested.WithSelf.F.%pattern_type.loc128_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc128_57.1, %Array.loc128_57.2 [symbolic = %return.patt.loc128_41.2 (constants.%return.patt.7a8)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc130_50: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.ref.loc128_50: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] -// CHECK:STDOUT: %Self.as_type.loc130_50: type = facet_access_type %Self.ref.loc130_50 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc130_50: type = converted %Self.ref.loc130_50, %Self.as_type.loc130_50 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %Array.loc130_57.2: type = class_type @Array, @Array(constants.%Self.as_type.8ab, constants.%int_4) [symbolic = %Array.loc130_57.1 (constants.%Array.d32)] -// CHECK:STDOUT: %.loc130_57.2: Core.Form = init_form %Array.loc130_57.2 [symbolic = %.loc130_57.1 (constants.%.ec2)] +// CHECK:STDOUT: %Self.as_type.loc128_50: type = facet_access_type %Self.ref.loc128_50 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc128_50: type = converted %Self.ref.loc128_50, %Self.as_type.loc128_50 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %Array.loc128_57.2: type = class_type @Array, @Array(constants.%Self.as_type.8ab, constants.%int_4) [symbolic = %Array.loc128_57.1 (constants.%Array.d32)] +// CHECK:STDOUT: %.loc128_57.2: Core.Form = init_form %Array.loc128_57.2 [symbolic = %.loc128_57.1 (constants.%.ec2)] // CHECK:STDOUT: %x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684) = value_param call_param0 -// CHECK:STDOUT: %.loc130_38.1: type = splice_block %.loc130_38.3 [symbolic = %tuple.type (constants.%tuple.type.684)] { -// CHECK:STDOUT: %Self.ref.loc130_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc130_16.2: type = facet_access_type %Self.ref.loc130_12 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc130_16: type = converted %Self.ref.loc130_12, %Self.as_type.loc130_16.2 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %ptr.loc130_16.2: type = ptr_type %.loc130_16 [symbolic = %ptr.loc130_16.1 (constants.%ptr.a16)] -// CHECK:STDOUT: %Self.ref.loc130_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc130_24: type = facet_access_type %Self.ref.loc130_24 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc130_24: type = converted %Self.ref.loc130_24, %Self.as_type.loc130_24 [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc128_38.1: type = splice_block %.loc128_38.3 [symbolic = %tuple.type (constants.%tuple.type.684)] { +// CHECK:STDOUT: %Self.ref.loc128_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.as_type.loc128_16.2: type = facet_access_type %Self.ref.loc128_12 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc128_16: type = converted %Self.ref.loc128_12, %Self.as_type.loc128_16.2 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %ptr.loc128_16.2: type = ptr_type %.loc128_16 [symbolic = %ptr.loc128_16.1 (constants.%ptr.a16)] +// CHECK:STDOUT: %Self.ref.loc128_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.as_type.loc128_24: type = facet_access_type %Self.ref.loc128_24 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc128_24: type = converted %Self.ref.loc128_24, %Self.as_type.loc128_24 [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.x.y.loc130_37.2: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc130_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc130_37.1 (constants.%struct_type.x.y.34d)] -// CHECK:STDOUT: %.loc130_38.2: %tuple.type.693 = tuple_literal (%ptr.loc130_16.2, %struct_type.x.y.loc130_37.2) [symbolic = %tuple (constants.%tuple.ea4)] -// CHECK:STDOUT: %.loc130_38.3: type = converted %.loc130_38.2, constants.%tuple.type.684 [symbolic = %tuple.type (constants.%tuple.type.684)] +// CHECK:STDOUT: %struct_type.x.y.loc128_37.2: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc128_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc128_37.1 (constants.%struct_type.x.y.34d)] +// CHECK:STDOUT: %.loc128_38.2: %tuple.type.693 = tuple_literal (%ptr.loc128_16.2, %struct_type.x.y.loc128_37.2) [symbolic = %tuple (constants.%tuple.ea4)] +// CHECK:STDOUT: %.loc128_38.3: type = converted %.loc128_38.2, constants.%tuple.type.684 [symbolic = %tuple.type (constants.%tuple.type.684)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684) = wrapper_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @SelfNested.WithSelf.F.%Array.loc130_57.1 (%Array.d32) = out_param call_param1 -// CHECK:STDOUT: %return: ref @SelfNested.WithSelf.F.%Array.loc130_57.1 (%Array.d32) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @SelfNested.WithSelf.F.%Array.loc128_57.1 (%Array.d32) = out_param call_param1 +// CHECK:STDOUT: %return: ref @SelfNested.WithSelf.F.%Array.loc128_57.1 (%Array.d32) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %SelfNested.assoc_type = assoc_entity element0, %SelfNested.WithSelf.F.decl [concrete = constants.%assoc0.5a5] // CHECK:STDOUT: @@ -701,22 +682,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingReturnType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc92_30.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = fn_decl @FMissingReturnType.as.J.impl.F.loc92_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] { +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc90_30.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = fn_decl @FMissingReturnType.as.J.impl.F.loc90_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc92_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc90_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc92_25: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc90_25: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc63_44.1: type = specific_constant @J.WithSelf.F.%.loc63_44.1, @J.WithSelf.F(constants.%J.facet.b68) [concrete = bool] // CHECK:STDOUT: %.loc63_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc63_44.2, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%.f34] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc92_30.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = fn_decl @FMissingReturnType.as.J.impl.F.loc92_30.2 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.2] { +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc90_30.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = fn_decl @FMissingReturnType.as.J.impl.F.loc90_30.2 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%b.param_patt.792] @@ -730,28 +711,28 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingReturnType.as.J.impl.F.decl.loc92_30.2), @FMissingReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingReturnType.as.J.impl.F.decl.loc90_30.2), @FMissingReturnType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.50a] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FMissingReturnType.as.J.impl.F.decl.loc92_30.1 +// CHECK:STDOUT: .F = %FMissingReturnType.as.J.impl.F.decl.loc90_30.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentParamType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc103_38.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = fn_decl @FDifferentParamType.as.J.impl.F.loc103_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] { +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc101_38.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = fn_decl @FDifferentParamType.as.J.impl.F.loc101_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.5d3 = value_param_pattern [concrete = constants.%b.param_patt.0a8] // CHECK:STDOUT: %b.patt: %pattern_type.5d3 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.f7e] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc103_34.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc101_34.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc103_34.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc103_34.2: Core.Form = init_form %.loc103_34.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc101_34.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc101_34.2: Core.Form = init_form %.loc101_34.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc103_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc101_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: %FDifferentParamType = value_param call_param1 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [concrete = constants.%FDifferentParamType] @@ -761,7 +742,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: %.loc63_44.1: type = specific_constant @J.WithSelf.F.%.loc63_44.1, @J.WithSelf.F(constants.%J.facet.73e) [concrete = bool] // CHECK:STDOUT: %.loc63_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc63_44.2, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc103_38.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = fn_decl @FDifferentParamType.as.J.impl.F.loc103_38.2 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.2] { +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc101_38.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = fn_decl @FDifferentParamType.as.J.impl.F.loc101_38.2 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%b.param_patt.792] @@ -775,11 +756,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentParamType.as.J.impl.F.decl.loc103_38.2), @FDifferentParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentParamType.as.J.impl.F.decl.loc101_38.2), @FDifferentParamType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.9e2] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentParamType.as.J.impl.F.decl.loc103_38.1 +// CHECK:STDOUT: .F = %FDifferentParamType.as.J.impl.F.decl.loc101_38.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } @@ -830,7 +811,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentReturnType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc125_38.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = fn_decl @FDifferentReturnType.as.J.impl.F.loc125_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] { +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc123_38.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = fn_decl @FDifferentReturnType.as.J.impl.F.loc123_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] @@ -839,19 +820,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: %pattern_type.b9f = return_slot_pattern %return.param_patt, %Self.ref [concrete = constants.%return.patt.e4f] // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [concrete = constants.%FDifferentReturnType] -// CHECK:STDOUT: %.loc125_34: Core.Form = init_form %Self.ref [concrete = constants.%.1f5] +// CHECK:STDOUT: %.loc123_34: Core.Form = init_form %Self.ref [concrete = constants.%.1f5] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc125_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc123_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc125_25: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc123_25: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: %return.param: ref %FDifferentReturnType = out_param call_param2 // CHECK:STDOUT: %return: ref %FDifferentReturnType = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc63_44.1: type = specific_constant @J.WithSelf.F.%.loc63_44.1, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = bool] // CHECK:STDOUT: %.loc63_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc63_44.2, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc125_38.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = fn_decl @FDifferentReturnType.as.J.impl.F.loc125_38.2 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.2] { +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc123_38.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = fn_decl @FDifferentReturnType.as.J.impl.F.loc123_38.2 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%b.param_patt.792] @@ -865,11 +846,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentReturnType.as.J.impl.F.decl.loc125_38.2), @FDifferentReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentReturnType.as.J.impl.F.decl.loc123_38.2), @FDifferentReturnType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.6a4] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentReturnType.as.J.impl.F.decl.loc125_38.1 +// CHECK:STDOUT: .F = %FDifferentReturnType.as.J.impl.F.decl.loc123_38.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } @@ -899,8 +880,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %Array.870 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.870 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc130_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc130_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%Array.870] -// CHECK:STDOUT: %.loc130_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc130_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%.a71] +// CHECK:STDOUT: %.loc128_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc128_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%Array.870] +// CHECK:STDOUT: %.loc128_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc128_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%.a71] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc138_87.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2 = fn_decl @SelfNestedBadParam.as.SelfNested.impl.F.loc138_87.2 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.2] { // CHECK:STDOUT: %.1: %pattern_type.1ec = specific_constant constants.%x.param_patt.255, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%x.param_patt.255] // CHECK:STDOUT: %x.patt: %pattern_type.1ec = wrapper_binding_pattern x, %.1 [concrete = constants.%x.patt.79a] @@ -946,8 +927,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %Array.870 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.870 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc130_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc130_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%Array.ce4] -// CHECK:STDOUT: %.loc130_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc130_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%.069] +// CHECK:STDOUT: %.loc128_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc128_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%Array.ce4] +// CHECK:STDOUT: %.loc128_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc128_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%.069] // CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc148_112.2: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2 = fn_decl @SelfNestedBadReturnType.as.SelfNested.impl.F.loc148_112.2 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.2] { // CHECK:STDOUT: %.1: %pattern_type.7fc = specific_constant constants.%x.param_patt.04c, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%x.param_patt.04c] // CHECK:STDOUT: %x.patt: %pattern_type.7fc = wrapper_binding_pattern x, %.1 [concrete = constants.%x.patt.10a] @@ -1088,7 +1069,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [concrete = constants.%FDifferentParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc97: = impl_self_witness @FDifferentParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.593] +// CHECK:STDOUT: %.loc95: = impl_self_witness @FDifferentParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.593] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1102,7 +1083,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [concrete = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108: = impl_self_witness @FDifferentImplicitParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.46c] +// CHECK:STDOUT: %.loc106: = impl_self_witness @FDifferentImplicitParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.46c] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1130,7 +1111,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [concrete = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc134: = impl_self_witness @SelfNestedBadParam.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.83b] +// CHECK:STDOUT: %.loc132: = impl_self_witness @SelfNestedBadParam.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.83b] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1200,27 +1181,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: return %FMissingImplicitParam.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc92_30.1(%self.param: bool, %b.param: bool); +// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc90_30.1(%self.param: bool, %b.param: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc92_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc92_30.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.b68)] { +// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc90_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc90_30.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.b68)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = name_ref F, @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc92_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] +// CHECK:STDOUT: %F.ref: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = name_ref F, @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc90_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.call: init %empty_tuple.type = call %FMissingReturnType.as.J.impl.F.bound(%self.param, %b.param) -// CHECK:STDOUT: %.loc92: bool = converted %FMissingReturnType.as.J.impl.F.call, [concrete = ] +// CHECK:STDOUT: %.loc90: bool = converted %FMissingReturnType.as.J.impl.F.call, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc103_38.1(%self.param: bool, %b.param: %FDifferentParamType) -> out %return.param: bool; +// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc101_38.1(%self.param: bool, %b.param: %FDifferentParamType) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc103_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc103_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.73e)] { +// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc101_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc101_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.73e)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = name_ref F, @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc103_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] +// CHECK:STDOUT: %F.ref: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = name_ref F, @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc101_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%FDifferentParamType)> [concrete = constants.%ImplicitAs.type.85e] -// CHECK:STDOUT: %.4: %ImplicitAs.assoc_type.a99 = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%FDifferentParamType, constants.%Self.862) [concrete = constants.%assoc0.8f3] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.a99 = name_ref Convert, %.4 [concrete = constants.%assoc0.8f3] -// CHECK:STDOUT: %.5: %FDifferentParamType = converted %b.param, [concrete = ] +// CHECK:STDOUT: %.loc101: %FDifferentParamType = converted %b.param, [concrete = ] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.call: init bool = call %FDifferentParamType.as.J.impl.F.bound(%self.param, ) // CHECK:STDOUT: return %FDifferentParamType.as.J.impl.F.call // CHECK:STDOUT: } @@ -1231,43 +1209,40 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc112_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%FDifferentImplicitParamType)> [concrete = constants.%ImplicitAs.type.444] -// CHECK:STDOUT: %.4: %ImplicitAs.assoc_type.884 = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%FDifferentImplicitParamType, constants.%Self.862) [concrete = constants.%assoc0.cb0] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.884 = name_ref Convert, %.4 [concrete = constants.%assoc0.cb0] -// CHECK:STDOUT: %.5: %FDifferentImplicitParamType = converted %self.param, [concrete = ] +// CHECK:STDOUT: %.loc112: %FDifferentImplicitParamType = converted %self.param, [concrete = ] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.call: init bool = call %FDifferentImplicitParamType.as.J.impl.F.bound(, %b.param) // CHECK:STDOUT: return %FDifferentImplicitParamType.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc125_38.1(%self.param: bool, %b.param: bool) -> out %return.param: %FDifferentReturnType; +// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc123_38.1(%self.param: bool, %b.param: bool) -> out %return.param: %FDifferentReturnType; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc125_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc125_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.6a7)] { +// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc123_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc123_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.6a7)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = name_ref F, @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc125_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] +// CHECK:STDOUT: %F.ref: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = name_ref F, @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc123_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %.loc125_38.1: ref %FDifferentReturnType = temporary_storage -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.call: init %FDifferentReturnType to %.loc125_38.1 = call %FDifferentReturnType.as.J.impl.F.bound(%self.param, %b.param) -// CHECK:STDOUT: %.loc125_38.2: bool = converted %FDifferentReturnType.as.J.impl.F.call, [concrete = ] +// CHECK:STDOUT: %.loc123_38.1: ref %FDifferentReturnType = temporary_storage +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.call: init %FDifferentReturnType to %.loc123_38.1 = call %FDifferentReturnType.as.J.impl.F.bound(%self.param, %b.param) +// CHECK:STDOUT: %.loc123_38.2: bool = converted %FDifferentReturnType.as.J.impl.F.call, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @SelfNested.WithSelf.F(@SelfNested.%Self: %SelfNested.type) { // CHECK:STDOUT: %Self: %SelfNested.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc130_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc130_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %ptr.loc130_16.1: type = ptr_type %Self.as_type.loc130_16.1 [symbolic = %ptr.loc130_16.1 (constants.%ptr.a16)] -// CHECK:STDOUT: %struct_type.x.y.loc130_37.1: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc130_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc130_37.1 (constants.%struct_type.x.y.34d)] -// CHECK:STDOUT: %tuple: %tuple.type.693 = tuple_value (%ptr.loc130_16.1, %struct_type.x.y.loc130_37.1) [symbolic = %tuple (constants.%tuple.ea4)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc130_16.1, %struct_type.x.y.loc130_37.1) [symbolic = %tuple.type (constants.%tuple.type.684)] -// CHECK:STDOUT: %pattern_type.loc130_9: type = pattern_type %tuple.type [symbolic = %pattern_type.loc130_9 (constants.%pattern_type.871)] -// CHECK:STDOUT: %x.param_patt.loc130_9.2: @SelfNested.WithSelf.F.%pattern_type.loc130_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc130_9.2 (constants.%x.param_patt.8f6)] -// CHECK:STDOUT: %x.patt.loc130_9.2: @SelfNested.WithSelf.F.%pattern_type.loc130_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc130_9.2 [symbolic = %x.patt.loc130_9.2 (constants.%x.patt.48b)] -// CHECK:STDOUT: %Array.loc130_57.1: type = class_type @Array, @Array(%Self.as_type.loc130_16.1, constants.%int_4) [symbolic = %Array.loc130_57.1 (constants.%Array.d32)] -// CHECK:STDOUT: %.loc130_57.1: Core.Form = init_form %Array.loc130_57.1 [symbolic = %.loc130_57.1 (constants.%.ec2)] -// CHECK:STDOUT: %pattern_type.loc130_57: type = pattern_type %Array.loc130_57.1 [symbolic = %pattern_type.loc130_57 (constants.%pattern_type.4a4)] -// CHECK:STDOUT: %return.param_patt.loc130_57.2: @SelfNested.WithSelf.F.%pattern_type.loc130_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc130_57.2 (constants.%return.param_patt.36b)] -// CHECK:STDOUT: %return.patt.loc130_41.2: @SelfNested.WithSelf.F.%pattern_type.loc130_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc130_57.2, %Array.loc130_57.1 [symbolic = %return.patt.loc130_41.2 (constants.%return.patt.7a8)] +// CHECK:STDOUT: %Self.as_type.loc128_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc128_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %ptr.loc128_16.1: type = ptr_type %Self.as_type.loc128_16.1 [symbolic = %ptr.loc128_16.1 (constants.%ptr.a16)] +// CHECK:STDOUT: %struct_type.x.y.loc128_37.1: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc128_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc128_37.1 (constants.%struct_type.x.y.34d)] +// CHECK:STDOUT: %tuple: %tuple.type.693 = tuple_value (%ptr.loc128_16.1, %struct_type.x.y.loc128_37.1) [symbolic = %tuple (constants.%tuple.ea4)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc128_16.1, %struct_type.x.y.loc128_37.1) [symbolic = %tuple.type (constants.%tuple.type.684)] +// CHECK:STDOUT: %pattern_type.loc128_9: type = pattern_type %tuple.type [symbolic = %pattern_type.loc128_9 (constants.%pattern_type.871)] +// CHECK:STDOUT: %x.param_patt.loc128_9.2: @SelfNested.WithSelf.F.%pattern_type.loc128_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc128_9.2 (constants.%x.param_patt.8f6)] +// CHECK:STDOUT: %x.patt.loc128_9.2: @SelfNested.WithSelf.F.%pattern_type.loc128_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc128_9.2 [symbolic = %x.patt.loc128_9.2 (constants.%x.patt.48b)] +// CHECK:STDOUT: %Array.loc128_57.1: type = class_type @Array, @Array(%Self.as_type.loc128_16.1, constants.%int_4) [symbolic = %Array.loc128_57.1 (constants.%Array.d32)] +// CHECK:STDOUT: %.loc128_57.1: Core.Form = init_form %Array.loc128_57.1 [symbolic = %.loc128_57.1 (constants.%.ec2)] +// CHECK:STDOUT: %pattern_type.loc128_57: type = pattern_type %Array.loc128_57.1 [symbolic = %pattern_type.loc128_57 (constants.%pattern_type.4a4)] +// CHECK:STDOUT: %return.param_patt.loc128_57.2: @SelfNested.WithSelf.F.%pattern_type.loc128_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc128_57.2 (constants.%return.param_patt.36b)] +// CHECK:STDOUT: %return.patt.loc128_41.2: @SelfNested.WithSelf.F.%pattern_type.loc128_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc128_57.2, %Array.loc128_57.1 [symbolic = %return.patt.loc128_41.2 (constants.%return.patt.7a8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684)) -> out %return.param: @SelfNested.WithSelf.F.%Array.loc130_57.1 (%Array.d32); +// CHECK:STDOUT: fn(%x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684)) -> out %return.param: @SelfNested.WithSelf.F.%Array.loc128_57.1 (%Array.d32); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc138_87.1(%x.param: %tuple.type.f65) -> out %return.param: %Array.870; @@ -1278,11 +1253,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.3: ref %Array.870 = splice_block %return.param {} // CHECK:STDOUT: %tuple.elem0: %ptr.52e = tuple_access %x.param, element0 // CHECK:STDOUT: %tuple.elem1: %struct_type.x.y.25d = tuple_access %x.param, element1 -// CHECK:STDOUT: %.4: %SelfNestedBadParam = struct_access %tuple.elem1, element0 -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [concrete = constants.%ImplicitAs.type.6b0] -// CHECK:STDOUT: %.5: %ImplicitAs.assoc_type.4ac = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%i32, constants.%Self.862) [concrete = constants.%assoc0.689] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.4ac = name_ref Convert, %.5 [concrete = constants.%assoc0.689] -// CHECK:STDOUT: %.6: %i32 = converted %.4, [concrete = ] +// CHECK:STDOUT: %.loc138_87.1: %SelfNestedBadParam = struct_access %tuple.elem1, element0 +// CHECK:STDOUT: %.loc138_87.2: %i32 = converted %.loc138_87.1, [concrete = ] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.call: init %Array.870 to %.3 = call %F.ref() // CHECK:STDOUT: return %SelfNestedBadParam.as.SelfNested.impl.F.call to %return.param // CHECK:STDOUT: } @@ -1420,19 +1392,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%Self.e81) { // CHECK:STDOUT: %Self => constants.%Self.e81 -// CHECK:STDOUT: %Self.as_type.loc130_16.1 => constants.%Self.as_type.8ab -// CHECK:STDOUT: %ptr.loc130_16.1 => constants.%ptr.a16 -// CHECK:STDOUT: %struct_type.x.y.loc130_37.1 => constants.%struct_type.x.y.34d +// CHECK:STDOUT: %Self.as_type.loc128_16.1 => constants.%Self.as_type.8ab +// CHECK:STDOUT: %ptr.loc128_16.1 => constants.%ptr.a16 +// CHECK:STDOUT: %struct_type.x.y.loc128_37.1 => constants.%struct_type.x.y.34d // CHECK:STDOUT: %tuple => constants.%tuple.ea4 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.684 -// CHECK:STDOUT: %pattern_type.loc130_9 => constants.%pattern_type.871 -// CHECK:STDOUT: %x.param_patt.loc130_9.2 => constants.%x.param_patt.8f6 -// CHECK:STDOUT: %x.patt.loc130_9.2 => constants.%x.patt.48b -// CHECK:STDOUT: %Array.loc130_57.1 => constants.%Array.d32 -// CHECK:STDOUT: %.loc130_57.1 => constants.%.ec2 -// CHECK:STDOUT: %pattern_type.loc130_57 => constants.%pattern_type.4a4 -// CHECK:STDOUT: %return.param_patt.loc130_57.2 => constants.%return.param_patt.36b -// CHECK:STDOUT: %return.patt.loc130_41.2 => constants.%return.patt.7a8 +// CHECK:STDOUT: %pattern_type.loc128_9 => constants.%pattern_type.871 +// CHECK:STDOUT: %x.param_patt.loc128_9.2 => constants.%x.param_patt.8f6 +// CHECK:STDOUT: %x.patt.loc128_9.2 => constants.%x.patt.48b +// CHECK:STDOUT: %Array.loc128_57.1 => constants.%Array.d32 +// CHECK:STDOUT: %.loc128_57.1 => constants.%.ec2 +// CHECK:STDOUT: %pattern_type.loc128_57 => constants.%pattern_type.4a4 +// CHECK:STDOUT: %return.param_patt.loc128_57.2 => constants.%return.param_patt.36b +// CHECK:STDOUT: %return.patt.loc128_41.2 => constants.%return.patt.7a8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf(constants.%SelfNested.facet.d0d) { @@ -1444,19 +1416,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) { // CHECK:STDOUT: %Self => constants.%SelfNested.facet.d0d -// CHECK:STDOUT: %Self.as_type.loc130_16.1 => constants.%SelfNestedBadParam -// CHECK:STDOUT: %ptr.loc130_16.1 => constants.%ptr.52e -// CHECK:STDOUT: %struct_type.x.y.loc130_37.1 => constants.%struct_type.x.y.25d +// CHECK:STDOUT: %Self.as_type.loc128_16.1 => constants.%SelfNestedBadParam +// CHECK:STDOUT: %ptr.loc128_16.1 => constants.%ptr.52e +// CHECK:STDOUT: %struct_type.x.y.loc128_37.1 => constants.%struct_type.x.y.25d // CHECK:STDOUT: %tuple => constants.%tuple.17a // CHECK:STDOUT: %tuple.type => constants.%tuple.type.5e1 -// CHECK:STDOUT: %pattern_type.loc130_9 => constants.%pattern_type.1ec -// CHECK:STDOUT: %x.param_patt.loc130_9.2 => constants.%x.param_patt.255 -// CHECK:STDOUT: %x.patt.loc130_9.2 => constants.%x.patt.79a -// CHECK:STDOUT: %Array.loc130_57.1 => constants.%Array.870 -// CHECK:STDOUT: %.loc130_57.1 => constants.%.a71 -// CHECK:STDOUT: %pattern_type.loc130_57 => constants.%pattern_type.ec1 -// CHECK:STDOUT: %return.param_patt.loc130_57.2 => constants.%return.param_patt.8ed -// CHECK:STDOUT: %return.patt.loc130_41.2 => constants.%return.patt.21a +// CHECK:STDOUT: %pattern_type.loc128_9 => constants.%pattern_type.1ec +// CHECK:STDOUT: %x.param_patt.loc128_9.2 => constants.%x.param_patt.255 +// CHECK:STDOUT: %x.patt.loc128_9.2 => constants.%x.patt.79a +// CHECK:STDOUT: %Array.loc128_57.1 => constants.%Array.870 +// CHECK:STDOUT: %.loc128_57.1 => constants.%.a71 +// CHECK:STDOUT: %pattern_type.loc128_57 => constants.%pattern_type.ec1 +// CHECK:STDOUT: %return.param_patt.loc128_57.2 => constants.%return.param_patt.8ed +// CHECK:STDOUT: %return.patt.loc128_41.2 => constants.%return.patt.21a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf(constants.%SelfNested.facet.e71) { @@ -1468,18 +1440,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) { // CHECK:STDOUT: %Self => constants.%SelfNested.facet.e71 -// CHECK:STDOUT: %Self.as_type.loc130_16.1 => constants.%SelfNestedBadReturnType -// CHECK:STDOUT: %ptr.loc130_16.1 => constants.%ptr.f55 -// CHECK:STDOUT: %struct_type.x.y.loc130_37.1 => constants.%struct_type.x.y.03e +// CHECK:STDOUT: %Self.as_type.loc128_16.1 => constants.%SelfNestedBadReturnType +// CHECK:STDOUT: %ptr.loc128_16.1 => constants.%ptr.f55 +// CHECK:STDOUT: %struct_type.x.y.loc128_37.1 => constants.%struct_type.x.y.03e // CHECK:STDOUT: %tuple => constants.%tuple.ef1 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.dce -// CHECK:STDOUT: %pattern_type.loc130_9 => constants.%pattern_type.7fc -// CHECK:STDOUT: %x.param_patt.loc130_9.2 => constants.%x.param_patt.04c -// CHECK:STDOUT: %x.patt.loc130_9.2 => constants.%x.patt.10a -// CHECK:STDOUT: %Array.loc130_57.1 => constants.%Array.ce4 -// CHECK:STDOUT: %.loc130_57.1 => constants.%.069 -// CHECK:STDOUT: %pattern_type.loc130_57 => constants.%pattern_type.5b0 -// CHECK:STDOUT: %return.param_patt.loc130_57.2 => constants.%return.param_patt.c20 -// CHECK:STDOUT: %return.patt.loc130_41.2 => constants.%return.patt.02d +// CHECK:STDOUT: %pattern_type.loc128_9 => constants.%pattern_type.7fc +// CHECK:STDOUT: %x.param_patt.loc128_9.2 => constants.%x.param_patt.04c +// CHECK:STDOUT: %x.patt.loc128_9.2 => constants.%x.patt.10a +// CHECK:STDOUT: %Array.loc128_57.1 => constants.%Array.ce4 +// CHECK:STDOUT: %.loc128_57.1 => constants.%.069 +// CHECK:STDOUT: %pattern_type.loc128_57 => constants.%pattern_type.5b0 +// CHECK:STDOUT: %return.param_patt.loc128_57.2 => constants.%return.param_patt.c20 +// CHECK:STDOUT: %return.patt.loc128_41.2 => constants.%return.patt.02d // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index 0988eaf4c117..79f51fb01934 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -11,8 +11,6 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_self_type_mismatch.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_self_type_mismatch.carbon -// CHECK:STDERR: fail_self_type_mismatch.carbon: error: cannot implicitly convert expression of type `C(i32 as I)` to `C(i32)` [ConversionFailure] -// CHECK:STDERR: fail_self_type_mismatch.carbon: note: type `C(i32 as I)` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessInContext] class C[T: type](X: T) {} @@ -29,8 +27,10 @@ impl bool as I { } impl i32 as I { + // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+5]]:3-18: error: cannot implicitly convert expression of type `C(i32 as I)` to `C(i32)` [ConversionFailure] + // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+4]]:3-18: note: type `C(i32 as I)` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+3]]:8-16: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE-12]]:3-19: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE-14]]:3-19: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F(c: C(i32)); } @@ -99,16 +99,6 @@ impl i32 as I { // CHECK:STDOUT: %i32.as.I.impl.F.bd5be1.2: %i32.as.I.impl.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.b02: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.862: %ImplicitAs.type.b02 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type.07d: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.eae: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.862) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.699: %ImplicitAs.WithSelf.Convert.type.eae = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.0f2: type = facet_type <@ImplicitAs, @ImplicitAs(%C.fef)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.529: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%C.fef) [concrete] -// CHECK:STDOUT: %assoc0.8cb: %ImplicitAs.assoc_type.529 = assoc_entity element0, imports.%Core.import_ref.a03 [concrete] -// CHECK:STDOUT: %assoc0.3a5: %ImplicitAs.assoc_type.07d = assoc_entity element0, imports.%Core.import_ref.9e1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -122,9 +112,6 @@ impl i32 as I { // CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.383: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.07d) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%assoc0 (constants.%assoc0.3a5)] -// CHECK:STDOUT: %Core.import_ref.a03: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.eae) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.699)] -// CHECK:STDOUT: %Core.import_ref.9e1 = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -135,31 +122,31 @@ impl i32 as I { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] { -// CHECK:STDOUT: %T.patt.loc17_10.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_10.2 (constants.%T.patt)] -// CHECK:STDOUT: %X.patt.loc17_19.1: @C.%pattern_type (%pattern_type.51d1c4.1) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc17_19.2 (constants.%X.patt.9f0)] +// CHECK:STDOUT: %T.patt.loc15_10.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_10.2 (constants.%T.patt)] +// CHECK:STDOUT: %X.patt.loc15_19.1: @C.%pattern_type (%pattern_type.51d1c4.1) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc15_19.2 (constants.%X.patt.9f0)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc17_12.1: type = splice_block %.loc17_12.2 [concrete = type] { -// CHECK:STDOUT: %.Self.frozen.loc17_10: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %.loc17_12.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc15_12.1: type = splice_block %.loc15_12.2 [concrete = type] { +// CHECK:STDOUT: %.Self.frozen.loc15_10: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.loc15_12.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc17_10.2: type = symbolic_binding T, 0 [symbolic = %T.loc17_10.1 (constants.%T)] -// CHECK:STDOUT: %.loc17_21: type = splice_block %T.ref [symbolic = %T.loc17_10.1 (constants.%T)] { -// CHECK:STDOUT: %.Self.frozen.loc17_19: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc17_10.2 [symbolic = %T.loc17_10.1 (constants.%T)] +// CHECK:STDOUT: %T.loc15_10.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_10.1 (constants.%T)] +// CHECK:STDOUT: %.loc15_21: type = splice_block %T.ref [symbolic = %T.loc15_10.1 (constants.%T)] { +// CHECK:STDOUT: %.Self.frozen.loc15_19: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_10.2 [symbolic = %T.loc15_10.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.loc17_19.2: @C.%T.loc17_10.1 (%T) = symbolic_binding X, 1 [symbolic = %X.loc17_19.1 (constants.%X)] +// CHECK:STDOUT: %X.loc15_19.2: @C.%T.loc15_10.1 (%T) = symbolic_binding X, 1 [symbolic = %X.loc15_19.1 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @bool.as.I.impl [concrete] {} { -// CHECK:STDOUT: %.loc24: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc22: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc24: = impl_self_witness @bool.as.I.impl.%.loc24, @I [concrete = constants.%.cb2] +// CHECK:STDOUT: %.loc22: = impl_self_witness @bool.as.I.impl.%.loc22, @I [concrete = constants.%.cb2] // CHECK:STDOUT: impl_decl @i32.as.I.impl [concrete] {} { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31: = impl_self_witness @i32.as.I.impl.%i32, @I [concrete = constants.%.c43] +// CHECK:STDOUT: %.loc29: = impl_self_witness @i32.as.I.impl.%i32, @I [concrete = constants.%.c43] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -168,16 +155,16 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.de2) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.20b)] { -// CHECK:STDOUT: %c.param_patt.loc21_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.758) = value_param_pattern [symbolic = %c.param_patt.loc21_9.2 (constants.%c.param_patt.97d)] -// CHECK:STDOUT: %c.patt.loc21_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.758) = wrapper_binding_pattern c, %c.param_patt.loc21_9.1 [symbolic = %c.patt.loc21_9.2 (constants.%c.patt.b29)] +// CHECK:STDOUT: %c.param_patt.loc19_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.758) = value_param_pattern [symbolic = %c.param_patt.loc19_9.2 (constants.%c.param_patt.97d)] +// CHECK:STDOUT: %c.patt.loc19_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.758) = wrapper_binding_pattern c, %c.param_patt.loc19_9.1 [symbolic = %c.patt.loc19_9.2 (constants.%c.patt.b29)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %c.param: @I.WithSelf.F.%C.loc21_17.1 (%C.bdb) = value_param call_param0 -// CHECK:STDOUT: %.loc21: type = splice_block %C.loc21_17.2 [symbolic = %C.loc21_17.1 (constants.%C.bdb)] { +// CHECK:STDOUT: %c.param: @I.WithSelf.F.%C.loc19_17.1 (%C.bdb) = value_param call_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %C.loc19_17.2 [symbolic = %C.loc19_17.1 (constants.%C.bdb)] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)] -// CHECK:STDOUT: %C.loc21_17.2: type = class_type @C, @C(constants.%I.type, constants.%Self.37e) [symbolic = %C.loc21_17.1 (constants.%C.bdb)] +// CHECK:STDOUT: %C.loc19_17.2: type = class_type @C, @C(constants.%I.type, constants.%Self.37e) [symbolic = %C.loc19_17.1 (constants.%C.bdb)] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: @I.WithSelf.F.%C.loc21_17.1 (%C.bdb) = wrapper_binding c, %c.param +// CHECK:STDOUT: %c: @I.WithSelf.F.%C.loc19_17.1 (%C.bdb) = wrapper_binding c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0.e24] // CHECK:STDOUT: @@ -192,18 +179,18 @@ impl i32 as I { // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @bool.as.I.impl: %.loc24 as %I.ref { +// CHECK:STDOUT: impl @bool.as.I.impl: %.loc22 as %I.ref { // CHECK:STDOUT: %bool.as.I.impl.F.decl: %bool.as.I.impl.F.type = fn_decl @bool.as.I.impl.F [concrete = constants.%bool.as.I.impl.F] { // CHECK:STDOUT: %c.param_patt: %pattern_type.c9b = value_param_pattern [concrete = constants.%c.param_patt.391] // CHECK:STDOUT: %c.patt: %pattern_type.c9b = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt.132] // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C.820 = value_param call_param0 -// CHECK:STDOUT: %.loc28_22: type = splice_block %C [concrete = constants.%C.820] { +// CHECK:STDOUT: %.loc26_22: type = splice_block %C [concrete = constants.%C.820] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %.loc28_13: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc26_13: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %.loc28_13, (constants.%I.impl_witness.c3b) [concrete = constants.%I.facet.31d] -// CHECK:STDOUT: %.loc28_18: %I.type = converted %.loc28_13, %I.facet [concrete = constants.%I.facet.31d] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %.loc26_13, (constants.%I.impl_witness.c3b) [concrete = constants.%I.facet.31d] +// CHECK:STDOUT: %.loc26_18: %I.type = converted %.loc26_13, %I.facet [concrete = constants.%I.facet.31d] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%I.type, constants.%I.facet.31d) [concrete = constants.%C.820] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.820 = wrapper_binding c, %c.param @@ -249,12 +236,12 @@ impl i32 as I { // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%T.loc17_10.2: type, %X.loc17_19.2: @C.%T.loc17_10.1 (%T)) { -// CHECK:STDOUT: %T.patt.loc17_10.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_10.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.loc17_10.1: type = symbolic_binding T, 0 [symbolic = %T.loc17_10.1 (constants.%T)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc17_10.1 [symbolic = %pattern_type (constants.%pattern_type.51d1c4.1)] -// CHECK:STDOUT: %X.patt.loc17_19.2: @C.%pattern_type (%pattern_type.51d1c4.1) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc17_19.2 (constants.%X.patt.9f0)] -// CHECK:STDOUT: %X.loc17_19.1: @C.%T.loc17_10.1 (%T) = symbolic_binding X, 1 [symbolic = %X.loc17_19.1 (constants.%X)] +// CHECK:STDOUT: generic class @C(%T.loc15_10.2: type, %X.loc15_19.2: @C.%T.loc15_10.1 (%T)) { +// CHECK:STDOUT: %T.patt.loc15_10.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_10.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.loc15_10.1: type = symbolic_binding T, 0 [symbolic = %T.loc15_10.1 (constants.%T)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc15_10.1 [symbolic = %pattern_type (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %X.patt.loc15_19.2: @C.%pattern_type (%pattern_type.51d1c4.1) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc15_19.2 (constants.%X.patt.9f0)] +// CHECK:STDOUT: %X.loc15_19.1: @C.%T.loc15_10.1 (%T) = symbolic_binding X, 1 [symbolic = %X.loc15_19.1 (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -269,12 +256,12 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.37e)] -// CHECK:STDOUT: %C.loc21_17.1: type = class_type @C, @C(constants.%I.type, %Self) [symbolic = %C.loc21_17.1 (constants.%C.bdb)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc21_17.1 [symbolic = %pattern_type (constants.%pattern_type.758)] -// CHECK:STDOUT: %c.param_patt.loc21_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.758) = value_param_pattern [symbolic = %c.param_patt.loc21_9.2 (constants.%c.param_patt.97d)] -// CHECK:STDOUT: %c.patt.loc21_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.758) = wrapper_binding_pattern c, %c.param_patt.loc21_9.2 [symbolic = %c.patt.loc21_9.2 (constants.%c.patt.b29)] +// CHECK:STDOUT: %C.loc19_17.1: type = class_type @C, @C(constants.%I.type, %Self) [symbolic = %C.loc19_17.1 (constants.%C.bdb)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc19_17.1 [symbolic = %pattern_type (constants.%pattern_type.758)] +// CHECK:STDOUT: %c.param_patt.loc19_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.758) = value_param_pattern [symbolic = %c.param_patt.loc19_9.2 (constants.%c.param_patt.97d)] +// CHECK:STDOUT: %c.patt.loc19_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.758) = wrapper_binding_pattern c, %c.param_patt.loc19_9.2 [symbolic = %c.patt.loc19_9.2 (constants.%c.patt.b29)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%c.param: @I.WithSelf.F.%C.loc21_17.1 (%C.bdb)); +// CHECK:STDOUT: fn(%c.param: @I.WithSelf.F.%C.loc19_17.1 (%C.bdb)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @bool.as.I.impl.F(%c.param: %C.820); @@ -284,20 +271,17 @@ impl i32 as I { // CHECK:STDOUT: fn @i32.as.I.impl.F.loc35_18.2(%c.param: %C.186) [thunk @i32.as.I.impl.%i32.as.I.impl.F.decl.loc35_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.01e)] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %i32.as.I.impl.F.type.48cdab.1 = name_ref F, @i32.as.I.impl.%i32.as.I.impl.F.decl.loc35_18.1 [concrete = constants.%i32.as.I.impl.F.bd5be1.1] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%C.fef)> [concrete = constants.%ImplicitAs.type.0f2] -// CHECK:STDOUT: %.2: %ImplicitAs.assoc_type.529 = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%C.fef, constants.%Self.862) [concrete = constants.%assoc0.8cb] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.529 = name_ref Convert, %.2 [concrete = constants.%assoc0.8cb] -// CHECK:STDOUT: %.3: %C.fef = converted %c.param, [concrete = ] +// CHECK:STDOUT: %.loc35: %C.fef = converted %c.param, [concrete = ] // CHECK:STDOUT: %i32.as.I.impl.F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T, constants.%X) { -// CHECK:STDOUT: %T.patt.loc17_10.2 => constants.%T.patt -// CHECK:STDOUT: %T.loc17_10.1 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc15_10.1 => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1 -// CHECK:STDOUT: %X.patt.loc17_19.2 => constants.%X.patt.9f0 -// CHECK:STDOUT: %X.loc17_19.1 => constants.%X +// CHECK:STDOUT: %X.patt.loc15_19.2 => constants.%X.patt.9f0 +// CHECK:STDOUT: %X.loc15_19.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.37e) { @@ -308,27 +292,27 @@ impl i32 as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%I.type, constants.%Self.37e) { -// CHECK:STDOUT: %T.patt.loc17_10.2 => constants.%T.patt -// CHECK:STDOUT: %T.loc17_10.1 => constants.%I.type +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc15_10.1 => constants.%I.type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6cb -// CHECK:STDOUT: %X.patt.loc17_19.2 => constants.%X.patt.3b7 -// CHECK:STDOUT: %X.loc17_19.1 => constants.%Self.37e +// CHECK:STDOUT: %X.patt.loc15_19.2 => constants.%X.patt.3b7 +// CHECK:STDOUT: %X.loc15_19.1 => constants.%Self.37e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.37e) { // CHECK:STDOUT: %Self => constants.%Self.37e -// CHECK:STDOUT: %C.loc21_17.1 => constants.%C.bdb +// CHECK:STDOUT: %C.loc19_17.1 => constants.%C.bdb // CHECK:STDOUT: %pattern_type => constants.%pattern_type.758 -// CHECK:STDOUT: %c.param_patt.loc21_9.2 => constants.%c.param_patt.97d -// CHECK:STDOUT: %c.patt.loc21_9.2 => constants.%c.patt.b29 +// CHECK:STDOUT: %c.param_patt.loc19_9.2 => constants.%c.param_patt.97d +// CHECK:STDOUT: %c.patt.loc19_9.2 => constants.%c.patt.b29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%I.type, constants.%I.facet.31d) { -// CHECK:STDOUT: %T.patt.loc17_10.2 => constants.%T.patt -// CHECK:STDOUT: %T.loc17_10.1 => constants.%I.type +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc15_10.1 => constants.%I.type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6cb -// CHECK:STDOUT: %X.patt.loc17_19.2 => constants.%X.patt.3b7 -// CHECK:STDOUT: %X.loc17_19.1 => constants.%I.facet.31d +// CHECK:STDOUT: %X.patt.loc15_19.2 => constants.%X.patt.3b7 +// CHECK:STDOUT: %X.loc15_19.1 => constants.%I.facet.31d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet.31d) { @@ -340,18 +324,18 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet.31d) { // CHECK:STDOUT: %Self => constants.%I.facet.31d -// CHECK:STDOUT: %C.loc21_17.1 => constants.%C.820 +// CHECK:STDOUT: %C.loc19_17.1 => constants.%C.820 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c9b -// CHECK:STDOUT: %c.param_patt.loc21_9.2 => constants.%c.param_patt.391 -// CHECK:STDOUT: %c.patt.loc21_9.2 => constants.%c.patt.132 +// CHECK:STDOUT: %c.param_patt.loc19_9.2 => constants.%c.param_patt.391 +// CHECK:STDOUT: %c.patt.loc19_9.2 => constants.%c.patt.132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(type, constants.%i32) { -// CHECK:STDOUT: %T.patt.loc17_10.2 => constants.%T.patt -// CHECK:STDOUT: %T.loc17_10.1 => type +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc15_10.1 => type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a5 -// CHECK:STDOUT: %X.patt.loc17_19.2 => constants.%X.patt.cb8 -// CHECK:STDOUT: %X.loc17_19.1 => constants.%i32 +// CHECK:STDOUT: %X.patt.loc15_19.2 => constants.%X.patt.cb8 +// CHECK:STDOUT: %X.loc15_19.1 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -365,18 +349,18 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet.01e) { // CHECK:STDOUT: %Self => constants.%I.facet.01e -// CHECK:STDOUT: %C.loc21_17.1 => constants.%C.186 +// CHECK:STDOUT: %C.loc19_17.1 => constants.%C.186 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e36 -// CHECK:STDOUT: %c.param_patt.loc21_9.2 => constants.%c.param_patt.21f -// CHECK:STDOUT: %c.patt.loc21_9.2 => constants.%c.patt.147 +// CHECK:STDOUT: %c.param_patt.loc19_9.2 => constants.%c.param_patt.21f +// CHECK:STDOUT: %c.patt.loc19_9.2 => constants.%c.patt.147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%I.type, constants.%I.facet.01e) { -// CHECK:STDOUT: %T.patt.loc17_10.2 => constants.%T.patt -// CHECK:STDOUT: %T.loc17_10.1 => constants.%I.type +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc15_10.1 => constants.%I.type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6cb -// CHECK:STDOUT: %X.patt.loc17_19.2 => constants.%X.patt.3b7 -// CHECK:STDOUT: %X.loc17_19.1 => constants.%I.facet.01e +// CHECK:STDOUT: %X.patt.loc15_19.2 => constants.%X.patt.3b7 +// CHECK:STDOUT: %X.loc15_19.1 => constants.%I.facet.01e // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index d24913fb97be..8ae0fa6d3f1e 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -163,8 +163,6 @@ impl A as X { } // --- fail_param_type_mismatch.carbon -// CHECK:STDERR: fail_param_type_mismatch.carbon: error: cannot implicitly convert expression of type `A` to `B` [ConversionFailure] -// CHECK:STDERR: fail_param_type_mismatch.carbon: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessInContext] library "[[@TEST_NAME]]"; @@ -176,8 +174,10 @@ class A {} class B {} impl A as I { + // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+5]]:3-13: error: cannot implicitly convert expression of type `A` to `B` [ConversionFailure] + // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+4]]:3-13: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+3]]:8-11: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE-8]]:3-16: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE-10]]:3-16: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F(a: B); } @@ -263,8 +263,8 @@ class C { impl as I(B) { // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+7]]:5-15: note: while building thunk calling this function [ThunkCallee] // CHECK:STDERR: - // CHECK:STDERR: fail_param_type_incomplete.carbon: error: cannot implicitly convert expression of type `B` to `C` [ConversionFailure] - // CHECK:STDERR: fail_param_type_incomplete.carbon: note: type `B` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+5]]:5-15: error: cannot implicitly convert expression of type `B` to `C` [ConversionFailure] + // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+4]]:5-15: note: type `B` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+3]]:10-13: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-13]]:3-13: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: @@ -459,24 +459,27 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.48cdab.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_48.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.bd5be1.1] // CHECK:STDOUT: %.loc10_48.1: ref %struct_type.d.c.b36 = temporary_storage -// CHECK:STDOUT: -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init %struct_type.d.c.b36 to %.loc10_48.1 = call %F.ref(%.5) -// CHECK:STDOUT: %.loc10_48.2: ref %struct_type.d.c.b36 = temporary %.loc10_48.1, %empty_tuple.type.as.I.impl.F.call -// CHECK:STDOUT: %.loc10_48.3: ref %empty_tuple.type = struct_access %.loc10_48.2, element1 -// CHECK:STDOUT: %.loc10_48.4: ref %empty_tuple.type = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc10_48.5: init %empty_tuple.type to %.loc10_48.4 = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_48.6: init %empty_tuple.type = converted %.loc10_48.3, %.loc10_48.5 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_48.7: init %empty_tuple.type to %.loc10_48.4 = in_place_init %.loc10_48.6 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_48.8: ref %empty_struct_type = struct_access %.loc10_48.2, element0 -// CHECK:STDOUT: %.loc10_48.9: ref %empty_struct_type = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc10_48.10: init %empty_struct_type to %.loc10_48.9 = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc10_48.11: init %empty_struct_type = converted %.loc10_48.8, %.loc10_48.10 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc10_48.12: init %empty_struct_type to %.loc10_48.9 = in_place_init %.loc10_48.11 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc10_48.13: init %struct_type.c.d.15a to %return.param = struct_init (%.loc10_48.7, %.loc10_48.12) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc10_48.14: init %struct_type.c.d.15a = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_48.13 [concrete = constants.%struct] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_48.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_48.2) -// CHECK:STDOUT: return %.loc10_48.14 to %return.param +// CHECK:STDOUT: %.loc10_48.2: %empty_struct_type = struct_access %x.param, element1 +// CHECK:STDOUT: %.loc10_48.3: %empty_tuple.type = struct_access %x.param, element0 +// CHECK:STDOUT: %struct: %struct_type.b.a.40c = struct_value (%.loc10_48.2, %.loc10_48.3) +// CHECK:STDOUT: %.loc10_48.4: %struct_type.b.a.40c = converted %x.param, %struct +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init %struct_type.d.c.b36 to %.loc10_48.1 = call %F.ref(%.loc10_48.4) +// CHECK:STDOUT: %.loc10_48.5: ref %struct_type.d.c.b36 = temporary %.loc10_48.1, %empty_tuple.type.as.I.impl.F.call +// CHECK:STDOUT: %.loc10_48.6: ref %empty_tuple.type = struct_access %.loc10_48.5, element1 +// CHECK:STDOUT: %.loc10_48.7: ref %empty_tuple.type = struct_access %return.param, element1 +// CHECK:STDOUT: %.loc10_48.8: init %empty_tuple.type to %.loc10_48.7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_48.9: init %empty_tuple.type = converted %.loc10_48.6, %.loc10_48.8 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_48.10: init %empty_tuple.type to %.loc10_48.7 = in_place_init %.loc10_48.9 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_48.11: ref %empty_struct_type = struct_access %.loc10_48.5, element0 +// CHECK:STDOUT: %.loc10_48.12: ref %empty_struct_type = struct_access %return.param, element0 +// CHECK:STDOUT: %.loc10_48.13: init %empty_struct_type to %.loc10_48.12 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_48.14: init %empty_struct_type = converted %.loc10_48.11, %.loc10_48.13 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_48.15: init %empty_struct_type to %.loc10_48.12 = in_place_init %.loc10_48.14 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_48.16: init %struct_type.c.d.15a to %return.param = struct_init (%.loc10_48.10, %.loc10_48.15) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc10_48.17: init %struct_type.c.d.15a = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_48.16 [concrete = constants.%struct] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_48.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_48.5) +// CHECK:STDOUT: return %.loc10_48.17 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_48.1(%self.param: ref %empty_struct_type) = "no_op"; @@ -612,19 +615,24 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.5, %.8) -// CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call -// CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 -// CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 -// CHECK:STDOUT: %.loc14_37.4: ref %B = class_element_access %.loc14_37.3, element0 -// CHECK:STDOUT: %addr.loc14: %ptr.432 = addr_of %.loc14_37.4 -// CHECK:STDOUT: %.loc14_37.5: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14 +// CHECK:STDOUT: %.loc14_37.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %.loc14_37.2: ref %A = converted %self.param, %.loc14_37.1 +// CHECK:STDOUT: %.loc14_37.3: ref %B = deref %other.param +// CHECK:STDOUT: %.loc14_37.4: ref %A = class_element_access %.loc14_37.3, element0 +// CHECK:STDOUT: %addr.loc14_37.1: %ptr.d43 = addr_of %.loc14_37.4 +// CHECK:STDOUT: %.loc14_37.5: %ptr.d43 = converted %other.param, %addr.loc14_37.1 +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc14_37.2, %.loc14_37.5) +// CHECK:STDOUT: %.loc14_37.6: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call +// CHECK:STDOUT: %.loc14_37.7: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.6 +// CHECK:STDOUT: %.loc14_37.8: ref %C = deref %.loc14_37.7 +// CHECK:STDOUT: %.loc14_37.9: ref %B = class_element_access %.loc14_37.8, element0 +// CHECK:STDOUT: %addr.loc14_37.2: %ptr.432 = addr_of %.loc14_37.9 +// CHECK:STDOUT: %.loc14_37.10: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14_37.2 // CHECK:STDOUT: %impl.elem0: %.19e = impl_witness_access constants.%Copy.impl_witness.730, element0 [concrete = constants.%ptr.as.Copy.impl.Op.0df] -// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.5, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.10, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%B) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.5, %specific_fn -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.5) +// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.10, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.10) // CHECK:STDOUT: return %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -683,8 +691,13 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_26.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.5, %.8) +// CHECK:STDOUT: %.loc13_26.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %.loc13_26.2: ref %A = converted %self.param, %.loc13_26.1 +// CHECK:STDOUT: %.loc13_26.3: %A = acquire_value %.loc13_26.2 +// CHECK:STDOUT: %.loc13_26.4: ref %A = class_element_access %other.param, element0 +// CHECK:STDOUT: %.loc13_26.5: ref %A = converted %other.param, %.loc13_26.4 +// CHECK:STDOUT: %.loc13_26.6: %A = acquire_value %.loc13_26.5 +// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc13_26.3, %.loc13_26.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -779,19 +792,24 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.5, %.8) -// CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call -// CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 -// CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 -// CHECK:STDOUT: %.loc14_37.4: ref %B = class_element_access %.loc14_37.3, element0 -// CHECK:STDOUT: %addr.loc14: %ptr.432 = addr_of %.loc14_37.4 -// CHECK:STDOUT: %.loc14_37.5: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14 +// CHECK:STDOUT: %.loc14_37.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %.loc14_37.2: ref %A = converted %self.param, %.loc14_37.1 +// CHECK:STDOUT: %.loc14_37.3: ref %B = deref %other.param +// CHECK:STDOUT: %.loc14_37.4: ref %A = class_element_access %.loc14_37.3, element0 +// CHECK:STDOUT: %addr.loc14_37.1: %ptr.d43 = addr_of %.loc14_37.4 +// CHECK:STDOUT: %.loc14_37.5: %ptr.d43 = converted %other.param, %addr.loc14_37.1 +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc14_37.2, %.loc14_37.5) +// CHECK:STDOUT: %.loc14_37.6: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call +// CHECK:STDOUT: %.loc14_37.7: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.6 +// CHECK:STDOUT: %.loc14_37.8: ref %C = deref %.loc14_37.7 +// CHECK:STDOUT: %.loc14_37.9: ref %B = class_element_access %.loc14_37.8, element0 +// CHECK:STDOUT: %addr.loc14_37.2: %ptr.432 = addr_of %.loc14_37.9 +// CHECK:STDOUT: %.loc14_37.10: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14_37.2 // CHECK:STDOUT: %impl.elem0: %.19e = impl_witness_access constants.%Copy.impl_witness.730, element0 [concrete = constants.%ptr.as.Copy.impl.Op.0df] -// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.5, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.10, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%B) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.5, %specific_fn -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.5) +// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.10, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.10) // CHECK:STDOUT: return %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -886,19 +904,24 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.5, %.8) -// CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call -// CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 -// CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 -// CHECK:STDOUT: %.loc14_37.4: ref %B = class_element_access %.loc14_37.3, element0 -// CHECK:STDOUT: %addr.loc14: %ptr.432 = addr_of %.loc14_37.4 -// CHECK:STDOUT: %.loc14_37.5: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14 +// CHECK:STDOUT: %.loc14_37.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %.loc14_37.2: ref %A = converted %self.param, %.loc14_37.1 +// CHECK:STDOUT: %.loc14_37.3: ref %B = deref %other.param +// CHECK:STDOUT: %.loc14_37.4: ref %A = class_element_access %.loc14_37.3, element0 +// CHECK:STDOUT: %addr.loc14_37.1: %ptr.d43 = addr_of %.loc14_37.4 +// CHECK:STDOUT: %.loc14_37.5: %ptr.d43 = converted %other.param, %addr.loc14_37.1 +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc14_37.2, %.loc14_37.5) +// CHECK:STDOUT: %.loc14_37.6: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call +// CHECK:STDOUT: %.loc14_37.7: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.6 +// CHECK:STDOUT: %.loc14_37.8: ref %C = deref %.loc14_37.7 +// CHECK:STDOUT: %.loc14_37.9: ref %B = class_element_access %.loc14_37.8, element0 +// CHECK:STDOUT: %addr.loc14_37.2: %ptr.432 = addr_of %.loc14_37.9 +// CHECK:STDOUT: %.loc14_37.10: %ptr.432 = converted %B.as.X.impl.F.call, %addr.loc14_37.2 // CHECK:STDOUT: %impl.elem0: %.19e = impl_witness_access constants.%Copy.impl_witness.730, element0 [concrete = constants.%ptr.as.Copy.impl.Op.0df] -// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.5, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc14_37.1: = bound_method %.loc14_37.10, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%B) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.5, %specific_fn -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.5) +// CHECK:STDOUT: %bound_method.loc14_37.2: = bound_method %.loc14_37.10, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.432 = call %bound_method.loc14_37.2(%.loc14_37.10) // CHECK:STDOUT: return %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -957,8 +980,12 @@ impl () as I({}) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_30.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.5, %.7) +// CHECK:STDOUT: %.loc13_30.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %.loc13_30.2: ref %A = converted %self.param, %.loc13_30.1 +// CHECK:STDOUT: %.loc13_30.3: %A = acquire_value %.loc13_30.2 +// CHECK:STDOUT: %.loc13_30.4: ref %A = class_element_access %other.param, element0 +// CHECK:STDOUT: %.loc13_30.5: ref %A = converted %other.param, %.loc13_30.4 +// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc13_30.3, %.loc13_30.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1039,8 +1066,11 @@ impl () as I({}) { // CHECK:STDOUT: fn @C.as.I.impl.F.loc11_48.2(%x.param: ref %empty_tuple.type, %y.param: %struct_type.a.b) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc11_48.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.aa5)] { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %C.as.I.impl.F.type.a24f58.1 = name_ref F, @C.as.I.impl.%C.as.I.impl.F.decl.loc11_48.1 [concrete = constants.%C.as.I.impl.F.4c1488.1] -// CHECK:STDOUT: -// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %F.ref(%x.param, %.5) +// CHECK:STDOUT: %.loc11_48.1: %empty_tuple.type = struct_access %y.param, element1 +// CHECK:STDOUT: %.loc11_48.2: %empty_tuple.type = struct_access %y.param, element0 +// CHECK:STDOUT: %struct: %struct_type.b.a = struct_value (%.loc11_48.1, %.loc11_48.2) +// CHECK:STDOUT: %.loc11_48.3: %struct_type.b.a = converted %y.param, %struct +// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %F.ref(%x.param, %.loc11_48.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 21b415a590ac..8871d8ade08e 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -151,16 +151,11 @@ fn G() { // CHECK:STDOUT: %C.val: %C.49b051.2 = struct_value () [symbolic] // CHECK:STDOUT: %.f6a: ref %C.49b051.2 = temporary invalid, %C.val [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.869: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.c97: %Destroy.WithSelf.SelfDestruct.type.869 = struct_value () [symbolic] -// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.df0 [concrete] // CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.50c: = lookup_impl_witness %C.49b051.2, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.8aa: %Destroy.type = facet_value %C.49b051.2, (%Destroy.lookup_impl_witness.50c) [symbolic] @@ -185,19 +180,17 @@ fn G() { // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//a, loc4_13, loaded [symbolic = constants.%Self.dda] // CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//a, loc4_13, unloaded // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.import_ref.8ba: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.df0: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.869) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.c97)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generated { -// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { // CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] // CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0 // CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.2 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] { // CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] // CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] // CHECK:STDOUT: } { @@ -342,46 +335,45 @@ fn G() { // CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.49b051.2)] // CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete.6db)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = struct_value () [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.9: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary invalid, %C.val [symbolic = %.9 (constants.%.f6a)] +// CHECK:STDOUT: %.loc8_24.9: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary invalid, %C.val [symbolic = %.loc8_24.9 (constants.%.f6a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.50c)] -// CHECK:STDOUT: %Destroy.facet.3: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.8aa)] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.561)] -// CHECK:STDOUT: %.10: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.3 [symbolic = %.10 (constants.%.aa7)] -// CHECK:STDOUT: %impl.elem2.2: @C.as.I.impl.F.loc8_24.2.%.10 (%.aa7) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.3: = bound_method %.9, %impl.elem2.2 [symbolic = %bound_method.3 (constants.%bound_method.ff7)] -// CHECK:STDOUT: %specific_impl_fn.2: = specific_impl_function %impl.elem2.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.3) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn.3c0)] -// CHECK:STDOUT: %bound_method.4: = bound_method %.9, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.a7a)] +// CHECK:STDOUT: %Destroy.facet.loc8_24.3: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc8_24.3 (constants.%Destroy.facet.8aa)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc8_24.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.561)] +// CHECK:STDOUT: %.loc8_24.10: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc8_24.3 [symbolic = %.loc8_24.10 (constants.%.aa7)] +// CHECK:STDOUT: %impl.elem2.loc8_24.2: @C.as.I.impl.F.loc8_24.2.%.loc8_24.10 (%.aa7) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc8_24.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc8_24.3: = bound_method %.loc8_24.9, %impl.elem2.loc8_24.2 [symbolic = %bound_method.loc8_24.3 (constants.%bound_method.ff7)] +// CHECK:STDOUT: %specific_impl_fn.loc8_24.2: = specific_impl_function %impl.elem2.loc8_24.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc8_24.3) [symbolic = %specific_impl_fn.loc8_24.2 (constants.%specific_impl_fn.3c0)] +// CHECK:STDOUT: %bound_method.loc8_24.4: = bound_method %.loc8_24.9, %specific_impl_fn.loc8_24.2 [symbolic = %bound_method.loc8_24.4 (constants.%bound_method.a7a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1 for imports.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.73adac.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.efddb7.1)] -// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.73adac.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.efddb7.1)] +// CHECK:STDOUT: %.loc8_24.1: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.73adac.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.efddb7.1)] +// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.73adac.1) = name_ref F, %.loc8_24.1 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.efddb7.1)] // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.1: = specific_function %F.ref, @C.as.I.impl.F.loc8_24.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)] -// CHECK:STDOUT: %.2: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary_storage -// CHECK:STDOUT: %.3: init @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) to %.2 = class_init () [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.4: init @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = converted %x.param, %.3 [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.5: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary %.2, %.4 [symbolic = %.9 (constants.%.f6a)] -// CHECK:STDOUT: %.6: @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = acquire_value %.5 [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.6) -// CHECK:STDOUT: %SelfDestruct.ref: %Destroy.assoc_type = name_ref SelfDestruct, imports.%Core.import_ref.8ba [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.1: @C.as.I.impl.F.loc8_24.2.%.10 (%.aa7) = impl_witness_access constants.%Destroy.lookup_impl_witness.50c, element2 [symbolic = %impl.elem2.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.1: = bound_method %.5, %impl.elem2.1 [symbolic = %bound_method.3 (constants.%bound_method.ff7)] -// CHECK:STDOUT: %Destroy.facet.1: %Destroy.type = facet_value constants.%C.49b051.2, (constants.%Destroy.lookup_impl_witness.50c) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.8aa)] -// CHECK:STDOUT: %.7: %Destroy.type = converted constants.%C.49b051.2, %Destroy.facet.1 [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.8aa)] -// CHECK:STDOUT: %Destroy.facet.2: %Destroy.type = facet_value constants.%C.49b051.2, (constants.%Destroy.lookup_impl_witness.50c) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.8aa)] -// CHECK:STDOUT: %.8: %Destroy.type = converted constants.%C.49b051.2, %Destroy.facet.2 [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.8aa)] -// CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem2.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.8aa) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn.3c0)] -// CHECK:STDOUT: %bound_method.2: = bound_method %.5, %specific_impl_fn.1 [symbolic = %bound_method.4 (constants.%bound_method.a7a)] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.2(%.5) +// CHECK:STDOUT: %.loc8_24.2: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary_storage +// CHECK:STDOUT: %.loc8_24.3: init @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) to %.loc8_24.2 = class_init () [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %.loc8_24.4: init @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = converted %x.param, %.loc8_24.3 [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %.loc8_24.5: ref @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = temporary %.loc8_24.2, %.loc8_24.4 [symbolic = %.loc8_24.9 (constants.%.f6a)] +// CHECK:STDOUT: %.loc8_24.6: @C.as.I.impl.F.loc8_24.2.%C (%C.49b051.2) = acquire_value %.loc8_24.5 [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.loc8_24.6) +// CHECK:STDOUT: %impl.elem2.loc8_24.1: @C.as.I.impl.F.loc8_24.2.%.loc8_24.10 (%.aa7) = impl_witness_access constants.%Destroy.lookup_impl_witness.50c, element2 [symbolic = %impl.elem2.loc8_24.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc8_24.1: = bound_method %.loc8_24.5, %impl.elem2.loc8_24.1 [symbolic = %bound_method.loc8_24.3 (constants.%bound_method.ff7)] +// CHECK:STDOUT: %Destroy.facet.loc8_24.1: %Destroy.type = facet_value constants.%C.49b051.2, (constants.%Destroy.lookup_impl_witness.50c) [symbolic = %Destroy.facet.loc8_24.3 (constants.%Destroy.facet.8aa)] +// CHECK:STDOUT: %.loc8_24.7: %Destroy.type = converted constants.%C.49b051.2, %Destroy.facet.loc8_24.1 [symbolic = %Destroy.facet.loc8_24.3 (constants.%Destroy.facet.8aa)] +// CHECK:STDOUT: %Destroy.facet.loc8_24.2: %Destroy.type = facet_value constants.%C.49b051.2, (constants.%Destroy.lookup_impl_witness.50c) [symbolic = %Destroy.facet.loc8_24.3 (constants.%Destroy.facet.8aa)] +// CHECK:STDOUT: %.loc8_24.8: %Destroy.type = converted constants.%C.49b051.2, %Destroy.facet.loc8_24.2 [symbolic = %Destroy.facet.loc8_24.3 (constants.%Destroy.facet.8aa)] +// CHECK:STDOUT: %specific_impl_fn.loc8_24.1: = specific_impl_function %impl.elem2.loc8_24.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.8aa) [symbolic = %specific_impl_fn.loc8_24.2 (constants.%specific_impl_fn.3c0)] +// CHECK:STDOUT: %bound_method.loc8_24.2: = bound_method %.loc8_24.5, %specific_impl_fn.loc8_24.1 [symbolic = %bound_method.loc8_24.4 (constants.%bound_method.a7a)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc8_24.2(%.loc8_24.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.2(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.2(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.2(%self.param: ref %empty_struct_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %empty_struct_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) // CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 021a9774e2f8..195058bd88cc 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -368,7 +368,6 @@ impl C2 as J2 where .U2 = C2 { } // --- fail_associated_type_in_signature_mismatch.carbon -// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon: error: cannot convert from struct type `{.a: ()}` to `{.x: ()}`: unexpected field `a` in source type [StructInitUnexpectedFieldInConversion] library "[[@TEST_NAME]]"; interface K { @@ -377,11 +376,12 @@ interface K { } impl () as K where .V = {.a: ()} { + // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+7]]:3-46: error: cannot convert from struct type `{.a: ()}` to `{.x: ()}`: unexpected field `a` in source type [StructInitUnexpectedFieldInConversion] // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+6]]:21-31: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-5]]:3-24: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-6]]:3-24: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+3]]:3-46: error: cannot convert from struct type `{.x: ()}` to `{.a: ()}`: unexpected field `x` in source type [StructInitUnexpectedFieldInConversion] - // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-8]]:3-24: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-9]]:3-24: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F(unused self, v: {.x: ()}) -> {.x: ()} { return v; } } diff --git a/toolchain/check/testdata/interop/cpp/class/import/override.carbon b/toolchain/check/testdata/interop/cpp/class/import/override.carbon index dccbb3279c5c..54b90e350129 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/override.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/override.carbon @@ -63,8 +63,6 @@ class Overload3Params { } // --- fail_overload_type.carbon -// CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure] -// CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext] // TODO: The conversion diagnostics here should have a location. library "[[@TEST_NAME]]"; @@ -74,28 +72,30 @@ import Cpp library "overload.h"; class OverloadX { extend base: Cpp.OverloadedBase; // - // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:23-30: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23-30: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: - // CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure] - // CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:23-30: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-10]]:10 [InCppInclude] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:23-30: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-12]]:10 [InCppInclude] // CHECK:STDERR: ./overload.h:7:16: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: - // CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure] - // CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext] override fn f(self, x: Cpp.X); } class OverloadY { extend base: Cpp.OverloadedBase; // + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23-30: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: - // CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure] - // CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure] + // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:23-30: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-26]]:10 [InCppInclude] + // CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-28]]:10 [InCppInclude] // CHECK:STDERR: ./overload.h:6:16: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: override fn f(self, y: Cpp.Y); diff --git a/toolchain/check/testdata/interop/cpp/impls/cpp_range_for_iterate.carbon b/toolchain/check/testdata/interop/cpp/impls/cpp_range_for_iterate.carbon index 05781a82e69c..2656aeec533a 100644 --- a/toolchain/check/testdata/interop/cpp/impls/cpp_range_for_iterate.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/cpp_range_for_iterate.carbon @@ -138,7 +138,6 @@ fn Test() { } // --- fail_todo_adl_returns_same_types_mutable.carbon -// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] // TODO: merge with adl_returns_same_types.carbon when passing. library "[[@TEST_NAME]]"; @@ -149,12 +148,13 @@ namespace N { class MutableRange { struct Iterator {}; public: - // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:34: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+4]]:34: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] // CHECK:STDERR: - // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] friend auto begin(MutableRange&) -> Iterator; + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+4]]:32: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] @@ -198,9 +198,8 @@ import Cpp inline '''c++ namespace N { class MutableRangeWithSentinel { struct Iterator { - // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+3]]:31: error: unknown type name 'ValueType' [CppInteropParseError] + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+2]]:31: error: unknown type name 'ValueType' [CppInteropParseError] // CHECK:STDERR: - // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] auto operator*() const -> ValueType&; auto operator++() -> Iterator&; }; @@ -210,12 +209,13 @@ class MutableRangeWithSentinel { friend auto operator!=(Sentinel, Iterator) -> bool; }; public: - // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:46: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+4]]:46: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] // CHECK:STDERR: - // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] friend auto begin(MutableRangeWithSentinel&) -> Iterator; + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+4]]:44: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] @@ -230,7 +230,6 @@ fn Test() { } // --- fail_todo_adl_overloads.carbon -// CHECK:STDERR: fail_todo_adl_overloads.carbon: error: value expression passed to reference parameter [ValueForRefParam] library "[[@TEST_NAME]]"; import Core library "cpp_range_for_iterate"; @@ -241,12 +240,13 @@ class MutableAndConstRange { struct Iterator {}; struct ConstIterator {}; public: - // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:42: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+4]]:42: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] // CHECK:STDERR: - // CHECK:STDERR: fail_todo_adl_overloads.carbon: error: value expression passed to reference parameter [ValueForRefParam] friend auto begin(MutableAndConstRange&) -> Iterator; + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+4]]:40: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam] diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index 818b9d32faea..e800928cddaf 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -228,7 +228,6 @@ fn TestRangeFor(c: Cpp.N.ConstRange) { } // --- fail_todo_adl_returns_same_types_mutable.carbon -// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] // TODO: merge with adl_returns_same_types.carbon when passing. @@ -244,6 +243,7 @@ class MutableRange { friend auto operator!=(Iterator, Iterator) -> bool; }; public: + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+3]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+2]]:34: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:41:3-29: note: while building thunk to match the signature of this function [ThunkSignature] friend auto begin(MutableRange&) -> Iterator; @@ -254,7 +254,7 @@ public: // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+7]]:1-64: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: -// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] +// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-7]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-8]]:32: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:42:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+2]]:1-64: note: while deducing parameters of generic declared here [DeductionGenericHere] @@ -335,7 +335,6 @@ fn TestRangeFor(c: Cpp.DiffADL.ConstRange) { } // --- fail_todo_adl_returns_different_types_mutable.carbon -// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] library "[[@TEST_NAME]]"; @@ -356,6 +355,7 @@ class MutableRange { friend auto operator!=(Sentinel, Iterator) -> bool; }; public: + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+3]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+2]]:34: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:41:3-29: note: while building thunk to match the signature of this function [ThunkSignature] friend auto begin(MutableRange&) -> Iterator; @@ -366,7 +366,7 @@ public: // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+7]]:1-89: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: -// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam] +// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-7]]:15: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-8]]:32: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:42:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+2]]:1-89: note: while deducing parameters of generic declared here [DeductionGenericHere] @@ -404,7 +404,6 @@ fn TestRangeFor(var m: Cpp.DiffMutableADL.MutableRange) { } // --- fail_todo_adl_overloads.carbon -// CHECK:STDERR: fail_todo_adl_overloads.carbon: error: value expression passed to reference parameter [ValueForRefParam] import Cpp inline '''c++ namespace OverloadADL { @@ -429,6 +428,7 @@ class MutableAndConstRange { friend auto operator!=(ConstIterator, ConstIterator) -> bool; }; public: + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+3]]:17: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+2]]:44: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:41:3-29: note: while building thunk to match the signature of this function [ThunkSignature] friend auto begin(MutableAndConstRange&) -> Iterator; @@ -442,7 +442,7 @@ class MutableAndConstRange { // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+7]]:1-86: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: -// CHECK:STDERR: fail_todo_adl_overloads.carbon: error: value expression passed to reference parameter [ValueForRefParam] +// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-10]]:17: error: value expression passed to reference parameter [ValueForRefParam] // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-11]]:42: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:42:3-27: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+2]]:1-86: note: while deducing parameters of generic declared here [DeductionGenericHere] diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index 2c9c1bdb044b..4248b8734b6a 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -219,8 +219,9 @@ static auto CloneFunctionDecl(Context& context, SemIR::LocId loc_id, // Perform callee-side pattern matching to rebuild the parameter list. context.inst_block_stack().Push(); - auto match_results = CalleePatternMatch(context, implicit_param_patterns_id, - param_patterns_id, return_pattern_id); + auto match_results = + CalleePatternMatch(context, loc_id, implicit_param_patterns_id, + param_patterns_id, return_pattern_id); auto pattern_block_id = context.pattern_block_stack().Pop(); auto decl_block_id = context.inst_block_stack().Pop(); @@ -276,7 +277,7 @@ auto PerformThunkCall(Context& context, SemIR::LocId loc_id, auto& function = context.functions().Get(function_id); auto [args_vec, ignored_call_args] = - ThunkPatternMatch(context, param_pattern_ids, call_arg_ids); + ThunkPatternMatch(context, loc_id, param_pattern_ids, call_arg_ids); llvm::ArrayRef args = args_vec; if (override_self_type_id.has_value()) { diff --git a/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon b/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon index 923e6ab8af74..160bddb20857 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon @@ -50,9 +50,9 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @_CCallNoInlineWithOptSize.Main() local_unnamed_addr #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !81 -// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !82 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !81 +// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !80 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !81 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !80 // CHECK:STDOUT: ret i32 %Int.as.AddWith.impl.Op.call.i, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -68,7 +68,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: %Int.as.MulAssignWith.impl.Op.call = load i32, ptr %.loc16_11.array.index, align 4, !dbg !31 // CHECK:STDOUT: %Int.as.MulAssignWith.impl.Op.call1 = shl i32 %Int.as.MulAssignWith.impl.Op.call, 1, !dbg !31 // CHECK:STDOUT: store i32 %Int.as.MulAssignWith.impl.Op.call1, ptr %.loc16_11.array.index, align 4, !dbg !31 -// CHECK:STDOUT: %1 = add nuw nsw i32 %n.var.03, 1, !dbg !90 +// CHECK:STDOUT: %1 = add nuw nsw i32 %n.var.03, 1, !dbg !89 // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.call = icmp samesign ult i32 %n.var.03, 65535, !dbg !27 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Less.call, label %while.body, label %while.done, !dbg !26 // CHECK:STDOUT: @@ -132,10 +132,10 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !57 = !{!51, !52} // CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !80 = distinct !DILocation(line: 9, column: 10, scope: !16) -// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !82 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !88 = distinct !DILocation(line: 17, column: 5, scope: !21) -// CHECK:STDOUT: !89 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !88) -// CHECK:STDOUT: !90 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !89) +// CHECK:STDOUT: !79 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !80 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !87 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !88 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !87) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !88) // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_default.carbon b/toolchain/driver/testdata/compile/optimize/optimize_default.carbon index a1c00ac93597..864f32b12364 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_default.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_default.carbon @@ -50,9 +50,9 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @_CCallNoInlineWithOptSize.Main() local_unnamed_addr #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !81 -// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !82 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !81 +// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !80 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !81 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !80 // CHECK:STDOUT: ret i32 %Int.as.AddWith.impl.Op.call.i, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -68,7 +68,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: %Int.as.MulAssignWith.impl.Op.call = load i32, ptr %.loc16_11.array.index, align 4, !dbg !31 // CHECK:STDOUT: %Int.as.MulAssignWith.impl.Op.call1 = shl i32 %Int.as.MulAssignWith.impl.Op.call, 1, !dbg !31 // CHECK:STDOUT: store i32 %Int.as.MulAssignWith.impl.Op.call1, ptr %.loc16_11.array.index, align 4, !dbg !31 -// CHECK:STDOUT: %1 = add nuw nsw i32 %n.var.03, 1, !dbg !90 +// CHECK:STDOUT: %1 = add nuw nsw i32 %n.var.03, 1, !dbg !89 // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.call = icmp samesign ult i32 %n.var.03, 65535, !dbg !27 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Less.call, label %while.body, label %while.done, !dbg !26 // CHECK:STDOUT: @@ -132,10 +132,10 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !57 = !{!51, !52} // CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !80 = distinct !DILocation(line: 9, column: 10, scope: !16) -// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !82 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !88 = distinct !DILocation(line: 17, column: 5, scope: !21) -// CHECK:STDOUT: !89 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !88) -// CHECK:STDOUT: !90 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !89) +// CHECK:STDOUT: !79 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !80 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !87 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !88 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !87) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !88) // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon index cffd680d5a07..51c9b7769944 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon @@ -98,7 +98,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #0 !dbg !50 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !53 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !54 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !54 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !54 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !54 @@ -165,7 +165,6 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !2) // CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !50, type: !2) -// CHECK:STDOUT: !53 = !DILocation(line: 0, scope: !50) // CHECK:STDOUT: !54 = !DILocation(line: 331, column: 3, scope: !50) // CHECK:STDOUT: !55 = !{!2, !2} // CHECK:STDOUT: !56 = !DISubroutineType(types: !55) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon index 94866beff4b7..0ba56dd5a514 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon @@ -97,7 +97,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline minsize nounwind optsize // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #2 !dbg !50 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !53 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !54 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !54 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !54 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !54 @@ -165,7 +165,6 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !2) // CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !50, type: !2) -// CHECK:STDOUT: !53 = !DILocation(line: 0, scope: !50) // CHECK:STDOUT: !54 = !DILocation(line: 331, column: 3, scope: !50) // CHECK:STDOUT: !55 = !{!2, !2} // CHECK:STDOUT: !56 = !DISubroutineType(types: !55) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon b/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon index f66024a40c14..a64902c2b409 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon @@ -50,9 +50,9 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @_CCallNoInlineWithOptSize.Main() local_unnamed_addr #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !81 -// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !82 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !81 +// CHECK:STDOUT: %Rand.call.loc4_15.i = tail call i32 @_CRand.Main() #0, !dbg !80 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !81 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !80 // CHECK:STDOUT: ret i32 %Int.as.AddWith.impl.Op.call.i, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -62,7 +62,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %vector.body, !dbg !26 // CHECK:STDOUT: // CHECK:STDOUT: vector.body: ; preds = %vector.body, %entry -// CHECK:STDOUT: %index = phi i32 [ 0, %entry ], [ %index.next.1, %vector.body ], !dbg !90 +// CHECK:STDOUT: %index = phi i32 [ 0, %entry ], [ %index.next.1, %vector.body ], !dbg !89 // CHECK:STDOUT: %0 = zext nneg i32 %index to i64, !dbg !31 // CHECK:STDOUT: %1 = getelementptr inbounds nuw [4 x i8], ptr %a, i64 %0, !dbg !31 // CHECK:STDOUT: %2 = getelementptr inbounds nuw i8, ptr %1, i64 16, !dbg !31 @@ -82,9 +82,9 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: %10 = shl <4 x i32> %wide.load4.1, splat (i32 1), !dbg !31 // CHECK:STDOUT: store <4 x i32> %9, ptr %7, align 4, !dbg !31 // CHECK:STDOUT: store <4 x i32> %10, ptr %8, align 4, !dbg !31 -// CHECK:STDOUT: %index.next.1 = add nuw nsw i32 %index, 16, !dbg !90 +// CHECK:STDOUT: %index.next.1 = add nuw nsw i32 %index, 16, !dbg !89 // CHECK:STDOUT: %11 = icmp eq i32 %index.next.1, 65536, !dbg !26 -// CHECK:STDOUT: br i1 %11, label %while.done, label %vector.body, !dbg !26, !llvm.loop !98 +// CHECK:STDOUT: br i1 %11, label %while.done, label %vector.body, !dbg !26, !llvm.loop !97 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %vector.body // CHECK:STDOUT: ret void, !dbg !35 @@ -147,13 +147,13 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !57 = !{!51, !52} // CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !80 = distinct !DILocation(line: 9, column: 10, scope: !16) -// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !82 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !80) -// CHECK:STDOUT: !88 = distinct !DILocation(line: 17, column: 5, scope: !21) -// CHECK:STDOUT: !89 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !88) -// CHECK:STDOUT: !90 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !89) -// CHECK:STDOUT: !95 = !{!"llvm.loop.isvectorized", i32 1} -// CHECK:STDOUT: !97 = !{!"llvm.loop.unroll.runtime.disable"} -// CHECK:STDOUT: !98 = distinct !{!98, !95, !97} +// CHECK:STDOUT: !79 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !80 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !81 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !79) +// CHECK:STDOUT: !87 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !88 = distinct !DILocation(line: 398, column: 5, scope: !42, inlinedAt: !87) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 331, column: 3, scope: !50, inlinedAt: !88) +// CHECK:STDOUT: !94 = !{!"llvm.loop.isvectorized", i32 1} +// CHECK:STDOUT: !96 = !{!"llvm.loop.unroll.runtime.disable"} +// CHECK:STDOUT: !97 = distinct !{!97, !94, !96} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index e14020558deb..9a8f85e752d6 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -232,7 +232,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #2 !dbg !162 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !165 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !166 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !166 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !166 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !166 @@ -407,7 +407,6 @@ fn F() { // CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !124, line: 331, type: !130, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !169) // CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !6) // CHECK:STDOUT: !164 = !DILocalVariable(arg: 2, scope: !162, type: !6) -// CHECK:STDOUT: !165 = !DILocation(line: 0, scope: !162) // CHECK:STDOUT: !166 = !DILocation(line: 331, column: 3, scope: !162) // CHECK:STDOUT: !167 = !{!6, !6} // CHECK:STDOUT: !168 = !DISubroutineType(types: !167) diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index 219bd758db32..96ae54b02802 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -1514,14 +1514,14 @@ fn Use() { // CHECK:STDOUT: define weak_odr void @"_CF:thunk:Base.Main:Derived.Main"(ptr sret({}) %return, ptr %self, ptr %n) #1 !dbg !429 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc17_52.2.temp = alloca {}, align 1, !dbg !433 -// CHECK:STDOUT: %.5.temp = alloca {}, align 1, !dbg !432 +// CHECK:STDOUT: %.loc17_52.4.temp = alloca {}, align 1, !dbg !433 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_52.2.temp), !dbg !433 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.5.temp), !dbg !432 -// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.5.temp, ptr %n), !dbg !432 -// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_52.2.temp, ptr %self, ptr %.5.temp), !dbg !433 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_52.4.temp), !dbg !433 +// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.loc17_52.4.temp, ptr %n), !dbg !433 +// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_52.2.temp, ptr %self, ptr %.loc17_52.4.temp), !dbg !433 // CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %return, ptr %.loc17_52.2.temp), !dbg !433 // CHECK:STDOUT: call void @"_CSelfDestruct.c2a743abd057cb33:core.Destroy.Core"(ptr %.loc17_52.2.temp), !dbg !433 -// CHECK:STDOUT: call void @"_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.5.temp), !dbg !432 +// CHECK:STDOUT: call void @"_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.loc17_52.4.temp), !dbg !433 // CHECK:STDOUT: ret void, !dbg !433 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1672,7 +1672,6 @@ fn Use() { // CHECK:STDOUT: !429 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:Base.Main:Derived.Main", scope: null, file: !414, line: 17, type: !419, spFlags: DISPFlagDefinition, unit: !415, retainedNodes: !434) // CHECK:STDOUT: !430 = !DILocalVariable(arg: 1, scope: !429, type: !20) // CHECK:STDOUT: !431 = !DILocalVariable(arg: 2, scope: !429, type: !20) -// CHECK:STDOUT: !432 = !DILocation(line: 0, scope: !429) // CHECK:STDOUT: !433 = !DILocation(line: 17, column: 3, scope: !429) // CHECK:STDOUT: !434 = !{!430, !431} // CHECK:STDOUT: !435 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !414, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !415, retainedNodes: !438) @@ -1683,9 +1682,9 @@ fn Use() { // CHECK:STDOUT: !440 = !DILocalVariable(arg: 1, scope: !439, type: !20) // CHECK:STDOUT: !441 = !DILocation(line: 17, column: 3, scope: !439) // CHECK:STDOUT: !442 = !{!440} -// CHECK:STDOUT: !443 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core", scope: null, file: !414, type: !22, spFlags: DISPFlagDefinition, unit: !415, retainedNodes: !446) +// CHECK:STDOUT: !443 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core", scope: null, file: !414, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !415, retainedNodes: !446) // CHECK:STDOUT: !444 = !DILocalVariable(arg: 1, scope: !443, type: !20) -// CHECK:STDOUT: !445 = !DILocation(line: 0, scope: !443) +// CHECK:STDOUT: !445 = !DILocation(line: 17, column: 3, scope: !443) // CHECK:STDOUT: !446 = !{!444} // CHECK:STDOUT: !447 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !414, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !415) // CHECK:STDOUT: !448 = !DILocation(line: 23, column: 3, scope: !447) diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 30b1a4b3f7f6..1faee1015884 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -266,7 +266,7 @@ fn For() { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #2 !dbg !178 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !181 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !182 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !182 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !182 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !182 @@ -458,7 +458,6 @@ fn For() { // CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !140, line: 331, type: !146, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) // CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !6) // CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !178, type: !6) -// CHECK:STDOUT: !181 = !DILocation(line: 0, scope: !178) // CHECK:STDOUT: !182 = !DILocation(line: 331, column: 3, scope: !178) // CHECK:STDOUT: !183 = !{!6, !6} // CHECK:STDOUT: !184 = !DISubroutineType(types: !183) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 3fa658611aac..269b5473682c 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -253,7 +253,7 @@ fn For() { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #2 !dbg !174 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !177 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !178 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !178 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !178 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !178 @@ -441,7 +441,6 @@ fn For() { // CHECK:STDOUT: !174 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !136, line: 331, type: !142, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !181) // CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !6) // CHECK:STDOUT: !176 = !DILocalVariable(arg: 2, scope: !174, type: !6) -// CHECK:STDOUT: !177 = !DILocation(line: 0, scope: !174) // CHECK:STDOUT: !178 = !DILocation(line: 331, column: 3, scope: !174) // CHECK:STDOUT: !179 = !{!6, !6} // CHECK:STDOUT: !180 = !DISubroutineType(types: !179) diff --git a/toolchain/lower/testdata/impl/import_thunk.carbon b/toolchain/lower/testdata/impl/import_thunk.carbon index 0e52fe964561..77cac07bdc99 100644 --- a/toolchain/lower/testdata/impl/import_thunk.carbon +++ b/toolchain/lower/testdata/impl/import_thunk.carbon @@ -104,14 +104,14 @@ fn Test(a: A) -> C { // CHECK:STDOUT: define weak_odr void @"_CF:thunk:I.6a2feaaa6331eb92.Main:61ea2aba74ab3bf1:I.Main"(ptr sret({ i32 }) %return, ptr %a) #1 !dbg !55 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc20_19.1.temp = alloca { i32 }, align 4, !dbg !58 -// CHECK:STDOUT: %.4.temp = alloca { i32 }, align 4, !dbg !57 +// CHECK:STDOUT: %.loc20_19.2.temp = alloca { i32 }, align 4, !dbg !58 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !57 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.4.temp, ptr %a), !dbg !57 -// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.4.temp), !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_19.2.temp), !dbg !58 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc20_19.2.temp, ptr %a), !dbg !58 +// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.loc20_19.2.temp), !dbg !58 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !58 // CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !57 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.2.temp), !dbg !58 // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -197,7 +197,6 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !54 = !{!47} // CHECK:STDOUT: !55 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.6a2feaaa6331eb92.Main:61ea2aba74ab3bf1:I.Main", scope: null, file: !18, line: 20, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !21) -// CHECK:STDOUT: !57 = !DILocation(line: 0, scope: !55) // CHECK:STDOUT: !58 = !DILocation(line: 20, column: 3, scope: !55) // CHECK:STDOUT: !59 = !{!56} // CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.72395be3dbbe8946:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) @@ -356,14 +355,14 @@ fn Test(a: A) -> C { // CHECK:STDOUT: define weak_odr void @"_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main"(ptr sret({ i32 }) %return, ptr %a) #1 !dbg !122 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc9_19.1.temp = alloca { i32 }, align 4, !dbg !125 -// CHECK:STDOUT: %.4.temp = alloca { i32 }, align 4, !dbg !124 +// CHECK:STDOUT: %.loc9_19.2.temp = alloca { i32 }, align 4, !dbg !125 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_19.1.temp), !dbg !125 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !124 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.4.temp, ptr %a), !dbg !124 -// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc9_19.1.temp, ptr %.4.temp), !dbg !125 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_19.2.temp), !dbg !125 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc9_19.2.temp, ptr %a), !dbg !125 +// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc9_19.1.temp, ptr %.loc9_19.2.temp), !dbg !125 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc9_19.1.temp), !dbg !125 // CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc9_19.1.temp), !dbg !125 -// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !124 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc9_19.2.temp), !dbg !125 // CHECK:STDOUT: ret void, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -441,7 +440,6 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !121 = !{!114} // CHECK:STDOUT: !122 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main", scope: null, file: !111, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !112, retainedNodes: !126) // CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !21) -// CHECK:STDOUT: !124 = !DILocation(line: 0, scope: !122) // CHECK:STDOUT: !125 = !DILocation(line: 9, column: 3, scope: !122) // CHECK:STDOUT: !126 = !{!123} // CHECK:STDOUT: !127 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.72395be3dbbe8946:core.Destroy.Core", scope: null, file: !111, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !112, retainedNodes: !130) diff --git a/toolchain/lower/testdata/impl/thunk.carbon b/toolchain/lower/testdata/impl/thunk.carbon index 87520a6aacb6..c41573e8b12e 100644 --- a/toolchain/lower/testdata/impl/thunk.carbon +++ b/toolchain/lower/testdata/impl/thunk.carbon @@ -108,14 +108,14 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: define weak_odr void @"_CF:thunk:I.6a2feaaa6331eb92.Main:61ea2aba74ab3bf1:I.Main"(ptr sret({ i32 }) %return, ptr %a) #1 !dbg !55 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc20_19.1.temp = alloca { i32 }, align 4, !dbg !58 -// CHECK:STDOUT: %.4.temp = alloca { i32 }, align 4, !dbg !57 +// CHECK:STDOUT: %.loc20_19.2.temp = alloca { i32 }, align 4, !dbg !58 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !57 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.4.temp, ptr %a), !dbg !57 -// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.4.temp), !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_19.2.temp), !dbg !58 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc20_19.2.temp, ptr %a), !dbg !58 +// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.loc20_19.2.temp), !dbg !58 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !58 // CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !57 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.2.temp), !dbg !58 // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -218,7 +218,6 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !54 = !{!47} // CHECK:STDOUT: !55 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.6a2feaaa6331eb92.Main:61ea2aba74ab3bf1:I.Main", scope: null, file: !18, line: 20, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !21) -// CHECK:STDOUT: !57 = !DILocation(line: 0, scope: !55) // CHECK:STDOUT: !58 = !DILocation(line: 20, column: 3, scope: !55) // CHECK:STDOUT: !59 = !{!56} // CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.72395be3dbbe8946:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) @@ -328,14 +327,14 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: define linkonce_odr void @"_CF:thunk:I.e2e8ace3e0ca3527.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #2 !dbg !155 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc18_32.2.temp = alloca {}, align 1, !dbg !159 -// CHECK:STDOUT: %.6.temp = alloca {}, align 1, !dbg !158 +// CHECK:STDOUT: %.loc18_32.3.temp = alloca {}, align 1, !dbg !159 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_32.2.temp), !dbg !159 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !158 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.6.temp, ptr %x), !dbg !158 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_32.2.temp, ptr %self, ptr %.6.temp), !dbg !159 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_32.3.temp), !dbg !159 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.loc18_32.3.temp, ptr %x), !dbg !159 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_32.2.temp, ptr %self, ptr %.loc18_32.3.temp), !dbg !159 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc18_32.2.temp), !dbg !159 // CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc18_32.2.temp), !dbg !159 -// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %.6.temp), !dbg !158 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %.loc18_32.3.temp), !dbg !159 // CHECK:STDOUT: ret void, !dbg !159 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,9 +371,9 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !21) // CHECK:STDOUT: !106 = !DILocation(line: 18, column: 3, scope: !104) // CHECK:STDOUT: !107 = !{!105} -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !89, type: !27, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !111) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !89, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !111) // CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !21) -// CHECK:STDOUT: !110 = !DILocation(line: 0, scope: !108) +// CHECK:STDOUT: !110 = !DILocation(line: 18, column: 3, scope: !108) // CHECK:STDOUT: !111 = !{!109} // CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !89, line: 21, type: !92, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !122) // CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !21) @@ -403,7 +402,6 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !155 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.e2e8ace3e0ca3527.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !89, line: 18, type: !92, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !160) // CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !21) // CHECK:STDOUT: !157 = !DILocalVariable(arg: 2, scope: !155, type: !21) -// CHECK:STDOUT: !158 = !DILocation(line: 0, scope: !155) // CHECK:STDOUT: !159 = !DILocation(line: 18, column: 3, scope: !155) // CHECK:STDOUT: !160 = !{!156, !157} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/operators/increment.carbon b/toolchain/lower/testdata/operators/increment.carbon index 2a966d9ad76d..7d21001b8e80 100644 --- a/toolchain/lower/testdata/operators/increment.carbon +++ b/toolchain/lower/testdata/operators/increment.carbon @@ -51,7 +51,7 @@ fn IncrSigned() { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26"(ptr %self, i32 %other) #2 !dbg !30 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !33 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.df8c28cb3df17b7d:ImplicitAs.c95da57eee1d2d0f.Core.25ef994321ea0701"(i32 %other), !dbg !34 // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !34 // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !34 // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !34 @@ -104,7 +104,6 @@ fn IncrSigned() { // CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.b59e374b0649c9ad.Core:Int.9452f4c51951679b.Core:AddAssignWith.ab03190a9e911cb4.Core.306167be98c24f26", scope: null, file: !21, line: 331, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) // CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !6) // CHECK:STDOUT: !32 = !DILocalVariable(arg: 2, scope: !30, type: !6) -// CHECK:STDOUT: !33 = !DILocation(line: 0, scope: !30) // CHECK:STDOUT: !34 = !DILocation(line: 331, column: 3, scope: !30) // CHECK:STDOUT: !35 = !{!6, !6} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) diff --git a/toolchain/lower/testdata/template/merging.carbon b/toolchain/lower/testdata/template/merging.carbon index b6287e0897a5..4a4b59fa6b54 100644 --- a/toolchain/lower/testdata/template/merging.carbon +++ b/toolchain/lower/testdata/template/merging.carbon @@ -254,51 +254,51 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.9522ff908e97e267() #0 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.4.temp = alloca {}, align 1, !dbg !81 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.4.temp), !dbg !81 -// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.4.temp, ptr @C.val.loc33_13.3), !dbg !81 +// CHECK:STDOUT: %.2a64a1.4.temp = alloca {}, align 1, !dbg !80 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.4.temp), !dbg !80 +// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.4.temp, ptr @C.val.loc33_13.3), !dbg !80 // CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.4.temp), !dbg !80 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.931317eeae6ffe17() #0 !dbg !83 { +// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.931317eeae6ffe17() #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.3.temp = alloca {}, align 1, !dbg !85 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.3.temp), !dbg !85 -// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.3.temp, ptr @D.val.loc34_13.3), !dbg !85 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.3.temp), !dbg !84 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: %.2a64a1.3.temp = alloca {}, align 1, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.3.temp), !dbg !83 +// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.3.temp, ptr @D.val.loc34_13.3), !dbg !83 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.3.temp), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.a6a60dfee2d7d273(ptr %x) #0 !dbg !87 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.a6a60dfee2d7d273(ptr %x) #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.B.Main(ptr %x), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %x), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !89 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.9522ff908e97e267(ptr %x) #0 !dbg !93 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.9522ff908e97e267(ptr %x) #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.2.temp = alloca {}, align 1, !dbg !96 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.2.temp), !dbg !96 -// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.2.temp, ptr %x), !dbg !96 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.2.temp), !dbg !96 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: %.2a64a1.2.temp = alloca {}, align 1, !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.2.temp), !dbg !94 +// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.2.temp, ptr %x), !dbg !94 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.2.temp), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.931317eeae6ffe17(ptr %x) #0 !dbg !99 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.931317eeae6ffe17(ptr %x) #0 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.1.temp = alloca {}, align 1, !dbg !102 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.1.temp), !dbg !102 -// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.1.temp, ptr %x), !dbg !102 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.1.temp), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: %.2a64a1.1.temp = alloca {}, align 1, !dbg !100 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.1.temp), !dbg !100 +// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.1.temp, ptr %x), !dbg !100 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.1.temp), !dbg !100 +// CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -368,27 +368,25 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: !78 = !DILocation(line: 18, column: 1, scope: !76) // CHECK:STDOUT: !79 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.9522ff908e97e267", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) // CHECK:STDOUT: !80 = !DILocation(line: 18, column: 37, scope: !79) -// CHECK:STDOUT: !81 = !DILocation(line: 0, scope: !79) -// CHECK:STDOUT: !82 = !DILocation(line: 18, column: 1, scope: !79) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.931317eeae6ffe17", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !84 = !DILocation(line: 18, column: 37, scope: !83) -// CHECK:STDOUT: !85 = !DILocation(line: 0, scope: !83) -// CHECK:STDOUT: !86 = !DILocation(line: 18, column: 1, scope: !83) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.a6a60dfee2d7d273", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !92) -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !24) -// CHECK:STDOUT: !90 = !DILocation(line: 28, column: 3, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 1, scope: !87) -// CHECK:STDOUT: !92 = !{!88} -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.9522ff908e97e267", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !98) -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !24) -// CHECK:STDOUT: !96 = !DILocation(line: 28, column: 3, scope: !93) -// CHECK:STDOUT: !97 = !DILocation(line: 27, column: 1, scope: !93) -// CHECK:STDOUT: !98 = !{!94} -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.931317eeae6ffe17", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !104) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !24) -// CHECK:STDOUT: !102 = !DILocation(line: 28, column: 3, scope: !99) -// CHECK:STDOUT: !103 = !DILocation(line: 27, column: 1, scope: !99) -// CHECK:STDOUT: !104 = !{!100} +// CHECK:STDOUT: !81 = !DILocation(line: 18, column: 1, scope: !79) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.931317eeae6ffe17", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !83 = !DILocation(line: 18, column: 37, scope: !82) +// CHECK:STDOUT: !84 = !DILocation(line: 18, column: 1, scope: !82) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.a6a60dfee2d7d273", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !90) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !24) +// CHECK:STDOUT: !88 = !DILocation(line: 28, column: 3, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 27, column: 1, scope: !85) +// CHECK:STDOUT: !90 = !{!86} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.9522ff908e97e267", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !96) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !24) +// CHECK:STDOUT: !94 = !DILocation(line: 28, column: 3, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 27, column: 1, scope: !91) +// CHECK:STDOUT: !96 = !{!92} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.931317eeae6ffe17", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !102) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !24) +// CHECK:STDOUT: !100 = !DILocation(line: 28, column: 3, scope: !97) +// CHECK:STDOUT: !101 = !DILocation(line: 27, column: 1, scope: !97) +// CHECK:STDOUT: !102 = !{!98} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'no_merge_convert_one_arg.carbon' @@ -397,65 +395,65 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: @A.val.loc6_45 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc6_45, i64 0, i1 false), !dbg !114 -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc6_45, i64 0, i1 false), !dbg !112 +// CHECK:STDOUT: ret void, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Main(ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallF.Main(ptr %a, ptr %b) #0 !dbg !116 { +// CHECK:STDOUT: define void @_CCallCallF.Main(ptr %a, ptr %b) #0 !dbg !114 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallF.Main.2877a42045e01a3b(ptr %a, ptr %a), !dbg !123 -// CHECK:STDOUT: call void @_CCallF.Main.d01354a0ad5f3687(ptr %a, ptr %b), !dbg !126 -// CHECK:STDOUT: call void @_CCallF.Main.37b67b83fe9ed3dd(ptr %b, ptr %a), !dbg !129 -// CHECK:STDOUT: call void @_CCallF.Main.7096323a0fb88cc3(ptr %b, ptr %b), !dbg !132 -// CHECK:STDOUT: ret void, !dbg !133 +// CHECK:STDOUT: call void @_CCallF.Main.2877a42045e01a3b(ptr %a, ptr %a), !dbg !121 +// CHECK:STDOUT: call void @_CCallF.Main.d01354a0ad5f3687(ptr %a, ptr %b), !dbg !124 +// CHECK:STDOUT: call void @_CCallF.Main.37b67b83fe9ed3dd(ptr %b, ptr %a), !dbg !127 +// CHECK:STDOUT: call void @_CCallF.Main.7096323a0fb88cc3(ptr %b, ptr %b), !dbg !130 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.2877a42045e01a3b(ptr %x, ptr %y) #0 !dbg !135 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.2877a42045e01a3b(ptr %x, ptr %y) #0 !dbg !133 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %y), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %y), !dbg !140 +// CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.d01354a0ad5f3687(ptr %x, ptr %y) #0 !dbg !145 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.d01354a0ad5f3687(ptr %x, ptr %y) #0 !dbg !143 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !151 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !151 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !151 -// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %.9745c1.4.temp), !dbg !152 -// CHECK:STDOUT: ret void, !dbg !153 +// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !149 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !149 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !149 +// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %.9745c1.4.temp), !dbg !150 +// CHECK:STDOUT: ret void, !dbg !151 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.37b67b83fe9ed3dd(ptr %x, ptr %y) #0 !dbg !155 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.37b67b83fe9ed3dd(ptr %x, ptr %y) #0 !dbg !153 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.3.temp = alloca {}, align 1, !dbg !160 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.3.temp), !dbg !160 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.3.temp, ptr %x), !dbg !160 -// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.3.temp, ptr %y), !dbg !162 -// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: %.9745c1.3.temp = alloca {}, align 1, !dbg !158 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.3.temp), !dbg !158 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.3.temp, ptr %x), !dbg !158 +// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.3.temp, ptr %y), !dbg !160 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.7096323a0fb88cc3(ptr %x, ptr %y) #0 !dbg !165 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.7096323a0fb88cc3(ptr %x, ptr %y) #0 !dbg !163 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !170 -// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !171 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.1.temp), !dbg !170 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.1.temp, ptr %x), !dbg !170 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.2.temp), !dbg !171 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !171 -// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.1.temp, ptr %.9745c1.2.temp), !dbg !172 -// CHECK:STDOUT: ret void, !dbg !173 +// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !168 +// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !169 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.1.temp), !dbg !168 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.1.temp, ptr %x), !dbg !168 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.2.temp), !dbg !169 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !169 +// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.1.temp, ptr %.9745c1.2.temp), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !171 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -467,7 +465,7 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!106} +// CHECK:STDOUT: !llvm.dbg.cu = !{!104} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -475,49 +473,49 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !27 = !{!24, !24} // CHECK:STDOUT: !28 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !105 = !DIFile(filename: "no_merge_convert_one_arg.carbon", directory: "") -// CHECK:STDOUT: !106 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !105, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !107 = !{null, !24, !24} -// CHECK:STDOUT: !108 = !DISubroutineType(types: !107) -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !105, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !115) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !24) -// CHECK:STDOUT: !114 = !DILocation(line: 6, column: 36, scope: !109) -// CHECK:STDOUT: !115 = !{!110} -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !105, line: 16, type: !108, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !134) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !24) -// CHECK:STDOUT: !118 = !DILocalVariable(arg: 2, scope: !116, type: !24) -// CHECK:STDOUT: !123 = !DILocation(line: 17, column: 3, scope: !116) -// CHECK:STDOUT: !126 = !DILocation(line: 18, column: 3, scope: !116) -// CHECK:STDOUT: !129 = !DILocation(line: 19, column: 3, scope: !116) -// CHECK:STDOUT: !132 = !DILocation(line: 20, column: 3, scope: !116) -// CHECK:STDOUT: !133 = !DILocation(line: 16, column: 1, scope: !116) -// CHECK:STDOUT: !134 = !{!117, !118} -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.2877a42045e01a3b", scope: null, file: !105, line: 12, type: !108, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !144) -// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !135, type: !24) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 2, scope: !135, type: !24) -// CHECK:STDOUT: !142 = !DILocation(line: 13, column: 3, scope: !135) -// CHECK:STDOUT: !143 = !DILocation(line: 12, column: 1, scope: !135) -// CHECK:STDOUT: !144 = !{!136, !137} -// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.d01354a0ad5f3687", scope: null, file: !105, line: 12, type: !108, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !154) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !24) -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 2, scope: !145, type: !24) -// CHECK:STDOUT: !151 = !DILocation(line: 13, column: 8, scope: !145) -// CHECK:STDOUT: !152 = !DILocation(line: 13, column: 3, scope: !145) -// CHECK:STDOUT: !153 = !DILocation(line: 12, column: 1, scope: !145) -// CHECK:STDOUT: !154 = !{!146, !147} -// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.37b67b83fe9ed3dd", scope: null, file: !105, line: 12, type: !108, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !164) -// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !24) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 2, scope: !155, type: !24) -// CHECK:STDOUT: !160 = !DILocation(line: 13, column: 5, scope: !155) -// CHECK:STDOUT: !162 = !DILocation(line: 13, column: 3, scope: !155) -// CHECK:STDOUT: !163 = !DILocation(line: 12, column: 1, scope: !155) -// CHECK:STDOUT: !164 = !{!156, !157} -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.7096323a0fb88cc3", scope: null, file: !105, line: 12, type: !108, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !174) -// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !24) -// CHECK:STDOUT: !167 = !DILocalVariable(arg: 2, scope: !165, type: !24) -// CHECK:STDOUT: !170 = !DILocation(line: 13, column: 5, scope: !165) -// CHECK:STDOUT: !171 = !DILocation(line: 13, column: 8, scope: !165) -// CHECK:STDOUT: !172 = !DILocation(line: 13, column: 3, scope: !165) -// CHECK:STDOUT: !173 = !DILocation(line: 12, column: 1, scope: !165) -// CHECK:STDOUT: !174 = !{!166, !167} +// CHECK:STDOUT: !103 = !DIFile(filename: "no_merge_convert_one_arg.carbon", directory: "") +// CHECK:STDOUT: !104 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !103, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !105 = !{null, !24, !24} +// CHECK:STDOUT: !106 = !DISubroutineType(types: !105) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !103, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !113) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !24) +// CHECK:STDOUT: !112 = !DILocation(line: 6, column: 36, scope: !107) +// CHECK:STDOUT: !113 = !{!108} +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !103, line: 16, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !132) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !24) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 2, scope: !114, type: !24) +// CHECK:STDOUT: !121 = !DILocation(line: 17, column: 3, scope: !114) +// CHECK:STDOUT: !124 = !DILocation(line: 18, column: 3, scope: !114) +// CHECK:STDOUT: !127 = !DILocation(line: 19, column: 3, scope: !114) +// CHECK:STDOUT: !130 = !DILocation(line: 20, column: 3, scope: !114) +// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 1, scope: !114) +// CHECK:STDOUT: !132 = !{!115, !116} +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.2877a42045e01a3b", scope: null, file: !103, line: 12, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !142) +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !24) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 2, scope: !133, type: !24) +// CHECK:STDOUT: !140 = !DILocation(line: 13, column: 3, scope: !133) +// CHECK:STDOUT: !141 = !DILocation(line: 12, column: 1, scope: !133) +// CHECK:STDOUT: !142 = !{!134, !135} +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.d01354a0ad5f3687", scope: null, file: !103, line: 12, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !152) +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !24) +// CHECK:STDOUT: !145 = !DILocalVariable(arg: 2, scope: !143, type: !24) +// CHECK:STDOUT: !149 = !DILocation(line: 13, column: 8, scope: !143) +// CHECK:STDOUT: !150 = !DILocation(line: 13, column: 3, scope: !143) +// CHECK:STDOUT: !151 = !DILocation(line: 12, column: 1, scope: !143) +// CHECK:STDOUT: !152 = !{!144, !145} +// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.37b67b83fe9ed3dd", scope: null, file: !103, line: 12, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !162) +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !24) +// CHECK:STDOUT: !155 = !DILocalVariable(arg: 2, scope: !153, type: !24) +// CHECK:STDOUT: !158 = !DILocation(line: 13, column: 5, scope: !153) +// CHECK:STDOUT: !160 = !DILocation(line: 13, column: 3, scope: !153) +// CHECK:STDOUT: !161 = !DILocation(line: 12, column: 1, scope: !153) +// CHECK:STDOUT: !162 = !{!154, !155} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.7096323a0fb88cc3", scope: null, file: !103, line: 12, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !172) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !24) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 2, scope: !163, type: !24) +// CHECK:STDOUT: !168 = !DILocation(line: 13, column: 5, scope: !163) +// CHECK:STDOUT: !169 = !DILocation(line: 13, column: 8, scope: !163) +// CHECK:STDOUT: !170 = !DILocation(line: 13, column: 3, scope: !163) +// CHECK:STDOUT: !171 = !DILocation(line: 12, column: 1, scope: !163) +// CHECK:STDOUT: !172 = !{!164, !165} // CHECK:STDOUT: diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 1fc0e1d5e193..299c87529a72 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -973,11 +973,10 @@ struct FormType : public SingletonTypeInst { // A function declaration. struct FunctionDecl { - static constexpr auto Kind = - InstKind::FunctionDecl.Define( - {.ir_name = "fn_decl", - .expr_category = ExprCategory::Value, - .is_lowered = false}); + static constexpr auto Kind = InstKind::FunctionDecl.Define( + {.ir_name = "fn_decl", + .expr_category = ExprCategory::Value, + .is_lowered = false}); TypeId type_id; FunctionId function_id;